Parcel: length of undefined

Created on 4 Jun 2020  路  5Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

馃帥 Configuration (.babelrc, package.json, cli command)

{
  "name": "barcode_ball_panel",
  "version": "1.0.0",
  "description": "",
  "main": "out.js",
  "scripts": {
    "build": "parcel build --no-source-maps --public-url ./ index.html",
    "start": "parcel index.html",
    "clean": "rimraf dist",
    "nuke": "rimraf dist .cache"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/NikosEfthias/barcode_ball_panel.git"
  },
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/NikosEfthias/barcode_ball_panel/issues"
  },
  "homepage": "https://github.com/NikosEfthias/barcode_ball_panel#readme",
  "devDependencies": {
    "bs-platform": "^7.3.2",
    "bsb-js": "^1.1.7",
    "elm-hot": "^1.1.4",
    "eslint": "^6.8.0",
    "node-elm-compiler": "^5.0.4",
    "parcel-bundler": "^1.12.4",
    "rimraf": "^3.0.2"
  },
  "dependencies": {
    "bootstrap": "^4.5.0"
  }
}

馃 Expected Behavior

parcelbundler used to build this project not i get an error it should just build fine as before since there are no updates to codebase

馃槸 Current Behavior

getting the following error

馃毃  Cannot read property 'length' of undefined
    at lineCounter (/home/nikos/.projects/barcode_ball_panel/node_modules/parc
el-bundler/src/utils/lineCounter.js:3:30)
    at JSPackager.writeModule (/home/nikos/.projects/barcode_ball_panel/node_m
odules/parcel-bundler/src/packagers/JSPackager.js:127:60)
    at async JSPackager.addAsset (/home/nikos/.projects/barcode_ball_panel/nod
e_modules/parcel-bundler/src/packagers/JSPackager.js:88:5)
    at async Bundle._addDeps (/home/nikos/.projects/barcode_ball_panel/node_mo
dules/parcel-bundler/src/Bundle.js:250:5)
    at async Bundle._package (/home/nikos/.projects/barcode_ball_panel/node_mo
dules/parcel-bundler/src/Bundle.js:219:7)
    at async Promise.all (index 0)
    at async Bundle.package (/home/nikos/.projects/barcode_ball_panel/node_mod
ules/parcel-bundler/src/Bundle.js:202:5)
    at async Promise.all (index 1)
    at async Bundle.package (/home/nikos/.projects/barcode_ball_panel/node_mod
ules/parcel-bundler/src/Bundle.js:202:5)
    at async Promise.all (index 1)

馃拋 Possible Solution

No Clue

馃敠 Context

馃捇 Code Sample

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel |1.12.4
| Node |14.1 and 12.18 both fails
| npm/Yarn |6.14
| Operating System |ubuntu focal

All 5 comments

no solutions to this ?

Does deleting the cache (.cache) help?

it seemingly helped but the weird thing is that I just pulled the repo from github which didnt have a .cache directory initially.

@mischnic I dont now why would you close this while it is clearly a bug. Again I am having the same issue and cleaning cache does not help this time

I could build with parcel by doing the following steps :

  • remove my global parcel installation, (yarn global remove parcel-bundler)
  • install parcel locally (yarn add --dev parcel@next)
  • add "start": "parcel src/index.html" in scripts of package.json
  • use yarn start to run parcel (since the global parcel command is not available anymore)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

humphd picture humphd  路  3Comments

algebraic-brain picture algebraic-brain  路  3Comments

devongovett picture devongovett  路  3Comments

Niggler picture Niggler  路  3Comments

will-stone picture will-stone  路  3Comments