Ty3uK / parcel-plugin-pug

Pug template support for Parcel bundler
MIT License
46 stars 6 forks source link

index.pug: Cannot read property 'start' of undefined #11

Closed icholy closed 6 years ago

icholy commented 6 years ago

I have a barebones project

$ node --version
v8.9.4

package.json

{
  "name": "thing",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "Ilia Choly <ilia.choly@gmail.com> (http://choly.ca)",
  "license": "ISC",
  "dependencies": {
    "parcel-bundler": "^1.6.2",
    "parcel-plugin-pug": "^0.2.5",
    "pug": "^2.0.0"
  }
}

index.pug

doctype html
html(lang="en")
  body
    h1 Hello World

output

$ parcel index.pug 
Server running at http://localhost:1234 
🚨  /home/icholy/Playground/thing/index.pug: Cannot read property 'start' of undefined
    at Parser.parseDoctype (/home/icholy/Playground/thing/node_modules/pug-parser/index.js:677:21)
    at Parser.parseExpr (/home/icholy/Playground/thing/node_modules/pug-parser/index.js:222:21)
    at Parser.parse (/home/icholy/Playground/thing/node_modules/pug-parser/index.js:112:25)
    at Object.parse (/home/icholy/Playground/thing/node_modules/pug-parser/index.js:12:20)
    at Function.loadString [as string] (/home/icholy/Playground/thing/node_modules/pug-load/index.js:45:21)
    at PugAsset.parse (/home/icholy/Playground/thing/node_modules/parcel-plugin-pug/build/PugAsset.js:36:24)
    at PugAsset.parseIfNeeded (/home/icholy/Playground/thing/node_modules/parcel-bundler/src/Asset.js:57:29)
    at <anonymous>
juanpablocs commented 6 years ago

same problem :(

npm run build

> parcel build index.pug
🚨  /home/juanpablocs/Projects/dev/series/index.pug: Cannot read property 'start' of undefined
    at Parser.parseTag (/home/juanpablocs/Projects/dev/series/node_modules/pug-parser/index.js:1040:37)
    at Parser.parseExpr (/home/juanpablocs/Projects/dev/series/node_modules/pug-parser/index.js:208:21)
    at Parser.parse (/home/juanpablocs/Projects/dev/series/node_modules/pug-parser/index.js:112:25)
    at Object.parse (/home/juanpablocs/Projects/dev/series/node_modules/pug-parser/index.js:12:20)
    at Function.loadString [as string] (/home/juanpablocs/Projects/dev/series/node_modules/pug-load/index.js:45:21)
    at PugAsset.parse (/home/juanpablocs/Projects/dev/series/node_modules/parcel-plugin-pug/build/PugAsset.js:36:24)
    at PugAsset.parseIfNeeded (/home/juanpablocs/Projects/dev/series/node_modules/parcel-bundler/src/Asset.js:57:29)
    at <anonymous>
Ty3uK commented 6 years ago

@icholy fixed in 0.2.7