router icon indicating copy to clipboard operation
router copied to clipboard

Is router-vite-plugin cjs build broken?

Open gunta opened this issue 1 year ago • 3 comments

Describe the bug

failed to load config from /home/runner/work/app/vite.config.mts
error during build:
Error: Cannot find module '../../../node_modules/.pnpm/[email protected]/node_modules/zod/lib/index.js'
Require stack:
- /home/runner/work/ais-nozomi/ais-nozomi/node_modules/@tanstack/router-vite-plugin/build/cjs/packages/router-cli/src/config.js
- /home/runner/work/ais-nozomi/ais-nozomi/node_modules/@tanstack/router-vite-plugin/build/cjs/packages/router-vite-plugin/src/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1134:15)
    at Module._load (node:internal/modules/cjs/loader:975:27)
    at Module.require (node:internal/modules/cjs/loader:1225:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (/home/runner/work/ais-nozomi/ais-nozomi/node_modules/@tanstack/router-vite-plugin/build/cjs/packages/router-cli/src/config.js:15:13)
    at Module._compile (node:internal/modules/cjs/loader:135[6](https://github.com/CyberAgentAI/ais-nozomi/actions/runs/7530405285/job/20496845389#step:5:7):14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
    at Module.load (node:internal/modules/cjs/loader:119[7](https://github.com/CyberAgentAI/ais-nozomi/actions/runs/7530405285/job/20496845389#step:5:8):32)
    at Module._load (node:internal/modules/cjs/loader:1013:12)
    at Module.require (node:internal/modules/cjs/loader:1225:1[9](https://github.com/CyberAgentAI/ais-nozomi/actions/runs/7530405285/job/20496845389#step:5:10))
error: script "build" exited with code 1
Error: Process completed with exit code 1.

Your Example Website or App

none

Steps to Reproduce the Bug or Issue

I'm using bun and vite along with router-vite-plugin on GitHub Actions.

I'm not sure where the problem is coming from, but looking at the router-vite-plugin CJS build, it looks like its pointing to a non-existent file handled by pnpm (I'm not using pnpm anywhere by the way).

Expected behavior

Expect to not have any pnpm route package inside the CJS build

Screenshots or Videos

No response

Platform

  • OS: [Linux] Running on GitHub Actions

Additional context

No response

gunta avatar Jan 15 '24 15:01 gunta

I am having the same issue when using bun. Switching to another package manager seems to fix it for now.

alrightsure avatar Jan 17 '24 04:01 alrightsure

Seems so weird, no one is using pnpm... Wonder whats going on

gunta avatar Jan 17 '24 06:01 gunta

i have same problem also.

primadi avatar Jan 17 '24 18:01 primadi

Thanks!

gunta avatar Jan 18 '24 18:01 gunta