Open Hmerman6006 opened 1 year ago
Could you post a StackBlitz repro? Would be good to know what package versions you're using.
Was a fresh install in a Laravel 8 environment with following package.json
dependencies:
"scripts": {
"dev": "mix",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "mix --production",
"production": "mix --production"
},
"devDependencies": {
"@babel/core": "^7.16.0",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/preset-env": "^7.16.0",
"babel-loader": "^8.2.3",
"laravel-mix": "^6.0.49",
"laravel-mix-svelte": "^0.5.0",
"lodash": "^4.17.19",
"resolve-url-loader": "^3.1.0",
"sass": "^1.32.13",
"sass-loader": "^11.1.1",
"svelte": "^3.1.0",
"svelte-loader": "^2.13.4",
},
"dependencies": {
"laravel-svelte-direct-mix": "0.0.1",
"svelte-multiselect": "^10.1.0"
}
Tried downgrading to v9, but did not work. Have not used StackBlitz yet: will try this weekend and send you feedback.
Are you setting
"type": "module",
in your package.json
?
+1 to this, I'm facing exactly the same issue
A fresh npm install solved it 🤔 weird, will look further into this to see what was triggering it
Ill add to this, I'm facing the same issue.
Changing export * from './types';
to export * from './types.js';
in both the dist/index.js and dist/index.d.ts fixes it.
Fresh install did not change anything for me.
I'm also hitting this error on an old project, same package.json
as @Hmerman6006's example
Are you setting
"type": "module",
in your
package.json
?
@janosh No I'm not
Thanks for the quick reply
i'm not firm on the details but i think Svelte is ESM-only at this point
Yeah but we're on Svelte 3, and this plugin used to work. I've even locked it back to version ^8.0 and no luck. Ah well, maybe someone finds something.
Edit:
OK "svelte": "^3.0.0"
+ "svelte-multiselect": "^7.0.0"
seems to do the trick, so not sure what happened starting with v8
When importing the component I get below output from npm:
I am not using TypeScript and I see the
types.js
file exports an empty object. How do I resolve this?