Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
Snowpack does not recognize Nunjucks template in "development" mode

I have a small Web "application" that uses Snowpack and Nunjucks. I've integrated snowpack-plugin-nunjucks 0.0.3 accordingly, but I can't really test the application whenever snowpack dev is executed.

The issue is that the server starts correctly and so on, but when I browse over the exposed address, the default entry point (index.html) is not recognized actually as HTML, but as application/octet-stream. Basically, what I get is a prompt to download a file, which in turn has the correct content (from index.html).

The snowpack.config.js contains only these few settings:

/** @type { import("snowpack").SnowpackUserConfig } */
export default {
  devOptions: {
    open: "none",
  },
  env: {
    // ...
  },
  exclude: ["**/*.test.js", "**/_*.njk"],
  mount: {
    src: "/",
  },
  optimize: {
    bundle: true,
    manifest: true,
    minify: true,
    sourcemap: "inline",
    target: "es2018",
  },
  plugins: ["snowpack-plugin-nunjucks"],
};

The application's content is inside src; these are the (excerpt for some of the) few files that I have so far:

{# index.njk #}
{% extends "src/_layout.njk" %}

{% set title = "Home" %}

{% block main %}
  <main>
    <h1>Lorem ipsum dolor sit amet.</h1>
  </main>
{%- endblock %}
{# _layout.njk #}
<!doctype html>
<html lang="en">
  <head>
    <title>{{ title }}</title>
  </head>
  <body>
    {% block body %}
    <div>
      {% block main %}
      {%- endblock %}
    </div>
    {%- endblock %}
  </body>
</html>

Is this an issue with Snowpack, the Nunjucks plugin, or the combination? Not sure what could be wrong, if anything, with the current configuration settings I'm using.

Any pointers would be great!

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda