Parcel: 馃悰 Uncaught Error: Cannot find module '[a number]'

Created on 11 Dec 2017  路  10Comments  路  Source: parcel-bundler/parcel

index.html
styles.css
main.js
style-for-main.css

in index.html:

<link rel='stylesheet' href='styles.css'>
<script src='main.js'></script>

in main.js:

import './style-for-main.css'

_throw an error in browser_

Bug

Most helpful comment

I've had this problem, too. But when I delete that .cache and restart, it's working.

All 10 comments

Hi! Thanks for reporting this.

Can you please provide the actual error that you鈥檙e seeing in the browser, as well as your Node and Parcel version numbers.

For future reference, please actually fill out the issue template :)

In browser
Uncaught Error: Cannot find module '4'
at newRequire (6723a4dcfb94ab73680250feba38b07f.js:32)
at localRequire (6723a4dcfb94ab73680250feba38b07f.js:38)
at Object.require.5._css_loader (6723a4dcfb94ab73680250feba38b07f.js:70)
at newRequire (6723a4dcfb94ab73680250feba38b07f.js:46)
at localRequire (6723a4dcfb94ab73680250feba38b07f.js:38)
at Object.require.3../style-for-main.css (6723a4dcfb94ab73680250feba38b07f.js:77)
at newRequire (6723a4dcfb94ab73680250feba38b07f.js:46)
at require.5._css_loader (6723a4dcfb94ab73680250feba38b07f.js:63)
at 6723a4dcfb94ab73680250feba38b07f.js:68

everything is well in node

Even more, Parcel wouldn't update the files when I remove the import './style-for-main.css';
I have got to restart Parcel to resolve it.

@rabbitmeow do you mind providing your entire project directory? The attachment appears to be the /dist directory of your project.

I've had this problem, too. But when I delete that .cache and restart, it's working.

I'm in class, talk to you guys later. 馃槄馃槄馃槄馃槶馃槶馃槶

bug

@rabbitmeow closing for now. Feel free to re-open with your src directory if this remains an issue.

Was this page helpful?
0 / 5 - 0 ratings