Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm run dev error caused by @builder.io/dev-tools: package.json invalid path #3035

Open
ijustwannacodetoday opened this issue Feb 29, 2024 · 2 comments
Assignees

Comments

@ijustwannacodetoday
Copy link

Hi, I just signed up for Builder, I’m on the “Welcome to Builder” screen, using “Integrate your existing project”.
I get an error when starting dev server - Error: Invalid path: C:\dev\project\code\package.json (7341) - when executing npm run dev on Windows.

Describe the bug
I created a new Qwik site using Cloudflare Pages integration following Deploy a Qwik site · Cloudflare Pages docs.
Then, I signed up at builder.io, and got to the “Welcome to Builder” screen, which said to run npm init builder.io@latest --existing to “Integrate your existing project”.
After that, I ran npm install and npm run dev, but it errors out right away with the following:

> dev
> vite --mode ssr

error when starting dev server:
Error: Invalid path: C:\dev\project\code\package.json (7341)
    at m (file:///C:/dev/project/code/node_modules/@builder.io/dev-tools/node/index.mjs:1:2907)
    at Object.readFile (file:///C:/dev/project/code/node_modules/@builder.io/dev-tools/node/index.mjs:1:1629)
    at f (file:///C:/dev/project/code/node_modules/@builder.io/dev-tools/node/index.mjs:1:466)
    at u (file:///C:/dev/project/code/node_modules/@builder.io/dev-tools/node/index.mjs:1:583)
    at $ (file:///C:/dev/project/code/node_modules/@builder.io/dev-tools/node/index.mjs:1:2704)
    at configureServer (file:///C:/dev/project/code/node_modules/@builder.io/dev-tools/vite/index.mjs:3:293)
    at _createServer (file:///C:/dev/project/code/node_modules/vite/dist/node/chunks/dep-jDlpJiMN.js:64550:30)
    at async CAC.<anonymous> (file:///C:/dev/project/code/node_modules/vite/dist/node/cli.js:762:24)

To Reproduce
Steps to reproduce the behavior on Windows:

  1. npm create cloudflare@latest my-qwik-app -- --framework=qwik
  2. npm init builder.io@latest --existing
  3. npm install
  4. npm run dev

Expected behavior
Qwik dev server working locally on a Windows machine after integrating Builder.

Additional context
These are the dependencies added:

    "@builder.io/dev-tools": "^0.2.19",
    "@builder.io/sdk-qwik": "^0.14.3"

And it fails here:

if(!o.startsWith(n))throw new Error(`Invalid path: ${o} (7341)`)

Debugging values:

n: 'C:/dev/project/code'
o: 'C:\dev\project\code\package.json'

The issue seems to stem from a non-normalized path separator.

Could anyone please help fix this?

@Megasware128
Copy link

I have the same issue with the vite qwik template. I'm also running Windows

@Mariolopez78
Copy link

I have the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants