Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module './src/data' #3864

Closed
haansn08 opened this issue Dec 2, 2019 · 4 comments
Closed

Error: Cannot find module './src/data' #3864

haansn08 opened this issue Dec 2, 2019 · 4 comments

Comments

@haansn08
Copy link

haansn08 commented Dec 2, 2019

🐛 bug report

Something broke really badly. 😬

😯 Current Behavior


> parcel-issue@1.0.0 start /home/stefan/playground/parcel-issue
> parcel src/index.html

Server running at http://localhost:1234 
⚠️  Parser "assets/JSAsset" failed to initialize when processing asset "src/index.js". Threw the following error:
Error: Cannot find module './src/data'
Require stack:
- /home/stefan/playground/parcel-issue/node_modules/core-js-compat/helpers.js
- /home/stefan/playground/parcel-issue/node_modules/core-js-compat/get-modules-list-for-target-version.js
- /home/stefan/playground/parcel-issue/node_modules/@babel/preset-env/lib/polyfills/corejs3/usage-plugin.js
- /home/stefan/playground/parcel-issue/node_modules/@babel/preset-env/lib/index.js
- /home/stefan/playground/parcel-issue/node_modules/parcel/src/transforms/babel/env.js
- /home/stefan/playground/parcel-issue/node_modules/parcel/src/transforms/babel/config.js
- /home/stefan/playground/parcel-issue/node_modules/parcel/src/transforms/babel/transform.js
- /home/stefan/playground/parcel-issue/node_modules/parcel/src/assets/JSAsset.js
- /home/stefan/playground/parcel-issue/node_modules/parcel/src/Parser.js
- /home/stefan/playground/parcel-issue/node_modules/parcel/src/Bundler.js
- /home/stefan/playground/parcel-issue/node_modules/parcel/index.js
- /home/stefan/playground/parcel-issue/node_modules/parcel/src/cli.js
- /home/stefan/playground/parcel-issue/node_modules/parcel/bin/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
    at Function.Module._load (internal/modules/cjs/loader.js:687:27)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (/home/stefan/playground/parcel-issue/node_modules/v8-compile-cache/v8-compile-cache.js:161:20)
    at Object.<anonymous> (/home/stefan/playground/parcel-issue/node_modules/core-js-compat/helpers.js:3:14)
    at Module._compile (/home/stefan/playground/parcel-issue/node_modules/v8-compile-cache/v8-compile-cache.js:194:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19) falling back to RawAsset
🚨  Cannot read property 'length' of undefined
    at lineCounter (/home/stefan/playground/parcel-issue/node_modules/parcel/src/utils/lineCounter.js:3:30)
    at JSPackager.writeModule (/home/stefan/playground/parcel-issue/node_modules/parcel/src/packagers/JSPackager.js:127:60)
    at async JSPackager.addAsset (/home/stefan/playground/parcel-issue/node_modules/parcel/src/packagers/JSPackager.js:88:5)
    at async Bundle._addDeps (/home/stefan/playground/parcel-issue/node_modules/parcel/src/Bundle.js:250:5)
    at async Bundle._package (/home/stefan/playground/parcel-issue/node_modules/parcel/src/Bundle.js:219:7)
    at async Promise.all (index 0)
    at async Bundle.package (/home/stefan/playground/parcel-issue/node_modules/parcel/src/Bundle.js:202:5)
    at async Promise.all (index 1)
    at async Bundle.package (/home/stefan/playground/parcel-issue/node_modules/parcel/src/Bundle.js:202:5)
    at async Bundler.bundle (/home/stefan/playground/parcel-issue/node_modules/parcel/src/Bundler.js:325:27)

💻 Code Sample

https://github.com/haansn08/parcel-issue-cannot-find-module-src-data

🌍 Your Environment

Software Version(s)
Parcel ^1.12.4
Node v12.13.0
npm/Yarn npm 6.13.1
Operating System Fedora 31 / x86_64 Linux 5.3.12-300
@fourcube
Copy link

fourcube commented Dec 2, 2019

Same problem here.

Edit: I encounter this error with parcel@2.0.0-alpha.3.2.

Edit: core-js-compat 3.4.6 seems to be broken. npm i -D core-js-compat@3.4.7 fixed this issue for me.

@mischnic
Copy link
Member

mischnic commented Dec 2, 2019

-> zloirock/core-js#710

@mischnic mischnic closed this as completed Dec 2, 2019
@LemonyPie
Copy link

still reproduces for me

@bidoubiwa
Copy link

I rm -rf node_modules and installed again and it fixed it for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants