[ERROR] No known conditions for "./vite" specifier in "solid-devtools" package
As soon as I import
import devtools from 'solid-devtools/vite';
in vite.config.js. I get the error
Using "solid-devtools": "^0.27.3",
and"solid-js": "^1.6.6",
I can't write type: module in package.json because it starts breaking the other code. Can anyone please help with the solution for this?
`✘ [ERROR] No known conditions for "./vite" specifier in "solid-devtools" package [plugin externalize-deps]
node_modules/esbuild/lib/main.js:1360:27:
1360 │ let result = await callback({
`
Hi, @lakshbhutani. I've got the same issue. Then I update all my packages:
"devDependencies": {
"solid-devtools": "^0.27.3",
"typescript": "^5.1.6",
"vite": "^4.4.4",
"vite-plugin-solid": "^2.7.0"
},
"dependencies": {
"solid-js": "^1.7.8"
}
Then after start I got [ERROR] Failed to resolve "solid-devtools/vite". This package is ESM only but it was tried to load by require. See http://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only for more details. [plugin externalize-deps]. Following the link, a solution provided: adding "type": "module" to the nearest package.json. After that fix, it starts successfully.
Also not ideal but worth noting that the other solution on that Vite mentions, changing vite.config.ts -> vite.config.mts, seems to fix this issue without impacting the rest of the project.
Dont worry tho, Solid Start got funding.