I am using parcel + pug for a project and everything was working great until I tried to add another page. It seems like it causes the bundler to fail.
Cannot find module '../node_modules/parcel-bundler/src/builtins/css-loader.js'
If I remove the reference to the styles or scripts it will work - however of course I need those.
App Structure
-- Root
-- html
-- index.pug
-- about.pug
-- styles
-- style.scss
-- scripts
-- index.js
The markup in the pages is pretty simple
doctype html
html(lang="en")
head
title= ""
meta(charset="utf-8")
meta(name="viewport", content="width=device-width, initial-scale=1.0")
link(rel="stylesheet" href="../styles/style.scss")
body
main
div.container
script(type="module", src="../scripts/index.js")
package.json
{
"name": "",
"version": "1.0.0",
"description": "",
"scripts": {
"dev": "parcel html/*",
},
"author": "",
"license": "ISC",
"dependencies": {},
"browserslist": [
"last 3 and_chr versions",
"last 3 chrome versions",
"last 3 opera versions",
"last 3 ios_saf versions",
"last 3 safari versions"
],
"devDependencies": {
"@parcel/css": "1.8.2",
"@parcel/transformer-css": "2.5.0",
"@parcel/transformer-pug": "2.5.0",
"@parcel/transformer-sass": "2.5.0",
"cssnano": "5.1.8",
"parcel": "2.5.0",
"parcel-bundler": "1.3.1",
"postcss": "8.4.14",
"pug": "3.0.2",
"sass": "1.51.0"
}
}
Update
This seems to happen when I link to any of the sub pages
a(href="/about.pug") About