solid-devtools icon indicating copy to clipboard operation
solid-devtools copied to clipboard

[ERROR] No known conditions for "./vite" specifier in "solid-devtools" package

Open lakshbhutani opened this issue 2 years ago • 3 comments

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({
  `

lakshbhutani avatar Jul 12 '23 09:07 lakshbhutani

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.

maestrow avatar Jul 15 '23 14:07 maestrow

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.

dcarr45 avatar Jul 17 '23 14:07 dcarr45

Dont worry tho, Solid Start got funding.

formbook avatar Jul 19 '23 08:07 formbook