Skip to content
Source
Sign inSign up
TanStack/router

Failing to resolve solid-js/web #5420

Send to my agent
Closedmurilobd(GitHub profile, opens in a new tab) opened this issue 13 comments

Which project does this relate to?

Router

Describe the bug

I cannot build my project anymore after version 1.132.51 as I'm receiving the following error:

error during build:
[vite]: Rollup failed to resolve import "solid-js/web" from ".../node_modules/@tanstack/router-devtools-core/dist/index-BiZF0hsR.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to

I'm not sure if this is because you moved solid-js from dependencies to devDependencies, but it doesn't make sense for me to install solid-js in my project.

Your Example Website or App

https://github.com/TanStack/router/releases/tag/v1.132.51

Steps to Reproduce the Bug or Issue

  1. Update @tanstack/react-router-devtools to v1.132.51 and build a project with vite
  2. It will output an error message like
error during build:
[vite]: Rollup failed to resolve import "solid-js/web" from ".../node_modules/@tanstack/router-devtools-core/dist/index-BiZF0hsR.js".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

Expected behavior

As a user I expect not to have to install solid-js library to use tanstack router devtools

Screenshots or Videos

No response

Platform

  • Router: 1.132.51
  • OS: macOS
  • Bundler: vite
  • Bundler Version: 7.1.9

Additional context

No response

  1. I suppose I caused this in https://github.com/TanStack/router/pull/5406, but I can't reproduce this because I'm getting a different error. I tried to create a new app following the docs and then build it:

    pnpx create-tsrouter-app@latest my-test-tanstack-app --template file-router
    cd my-test-tanstack-app
    pnpm build

    I got the error:

    error during build:
    rollupOptions.input should not be an html file when building for SSR. Please specify a dedicated SSR entry.

    When I upgraded an existing project I have to the latest version and then rebuilt it, it succeeded without error.

  2. Okay, not sure about the other issue I hit trying to reproduce this, but I've sent a fix for the issue originally described here

  3. I am having the same issue: Module not found: Error: Can't resolve 'solid-js/web' for tanstack router devtools. node_modules@tanstack\router-devtools-core\dist 6 of theses errors

    I removed my node modules, reinstalled everything, cleared my cache. still the same

  4. Same here

    {
        "@tanstack/react-devtools": "^0.7.0",
        "@tanstack/react-router": "^1.132.0",
        "@tanstack/react-router-devtools": "^1.132.0",
        "@tanstack/router-plugin": "^1.132.0"
    }
  5. I suppose I caused this in #5406, but I can't reproduce this because I'm getting a different error. I tried to create a new app following the docs and then build it:

    pnpx create-tsrouter-app@latest my-test-tanstack-app --template file-router
    cd my-test-tanstack-app
    pnpm build

    I got the error:

    error during build:
    rollupOptions.input should not be an html file when building for SSR. Please specify a dedicated SSR entry.

    When I upgraded an existing project I have to the latest version and then rebuilt it, it succeeded without error.

    yarn create create-tsrouter-app@latest my-test-tanstack-app --template file-router
    cd my-test-tanstack-app
    yarn build

    You moved solid-js to dev dependencies, and now it has to be installed manually in the project to avoid an error.

  6. Have this issue with

    {
        "@tanstack/react-query": "^5.83.0",
        "@tanstack/react-router": "^1.129.8",
        "@tanstack/react-router-devtools": "^1.129.8",
        "@tanstack/router-plugin": "^1.129.8"
    }
  7. Same issue on vercel deployment

     [vite]: Rollup failed to resolve import "solid-js/web" from "/vercel/path0/node_modules/@tanstack/router-devtools-core/dist/index-BiZF0hsR.js".
    This is most likely unintended because it can break your application at runtime.
    If you do want to externalize this module explicitly add it to
    `build.rollupOptions.external`
        at viteLog (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-Chhhsdoe.js:33989:57)
        at onRollupLog (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-Chhhsdoe.js:34021:7)
        at onLog (file:///vercel/path0/node_modules/vite/dist/node/chunks/dep-Chhhsdoe.js:33821:4)
        at file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:20937:32
        at Object.logger [as onLog] (file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:22823:9)
        at ModuleLoader.handleInvalidResolvedId (file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:21567:26)
        at file:///vercel/path0/node_modules/rollup/dist/es/shared/node-entry.js:21525:26
    error Command failed with exit code 1.
  8. The issue is that when I tested https://github.com/TanStack/router/pull/5406, I had solid in my node_modules, so didn't notice that the bundling wasn't actually happening and it allowed the app to work on my machine. https://github.com/TanStack/router/pull/5422 should fix it, but it requires updating @tanstack/config, which isn't working and I'm going to need some help with that as I have no idea what the issue with the upgrade is

  9. schiller-manuel(GitHub profile, opens in a new tab) added labelsneeded-for-start-stable

  10. Hello 👋

    This was marked as completed and released in https://github.com/TanStack/router/releases/tag/v1.133.2, but I can't see new versions of the devtools packages.

    Am I misunderstanding?

    Thanks!

  11. You're absolutely right, a new version of router-devtools-core and downstream dependants have to be published. I tried getting this moving today, and hit some CI issues with Nx Cloud not responding - I'll trigger a publish workflow asap

  12. @tmarnet , this should be resolved with the new 1.133.3 releases - can you confirm that is the case?

  13. @tmarnet , this should be resolved with the new 1.133.3 releases - can you confirm that is the case?

    It is! Thank you very much 🙂

Sign in to join this conversation.