Closed orlov-vo closed 4 years ago
I think this is rather related to the sub packages inside of svelte
:
node_modules/svelte/
├── internal
│ ├── index.mjs
│ └── package.json
├── package.json
└── store
├── index.mjs
└── package.json
I updated the issue and the example with fresh Parcel version.
The main/module/browser fields in package.json turn on library mode: node modules aren't bundled (as you would expect for a library...). It tried that in this case as well. But having imports to bare specifiers on a webpage wouldn't work, therefore the error.
To fix this:
diff --git package.json package.json
index 7570c2c..385ad5b 100644
--- package.json
+++ package.json
@@ -1,6 +1,5 @@
{
"name": "parcel2-example-bug",
- "browser": "dist/index.html",
"source": "src/index.html",
"private": true,
"scripts": {
🐛 bug report
I got a problem in
parcel@2.0.0-alpha.2.1
when I import a module which containindex.mjs
andindex.js
. For examplesvelte@3.12.1
- check my exampleWhen I manualy remove
index.mjs
fromsvelte
it works fine