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

Errors running starter templates #429

Open
jeffrenken opened this issue Jan 16, 2025 · 3 comments
Open

Errors running starter templates #429

jeffrenken opened this issue Jan 16, 2025 · 3 comments

Comments

@jeffrenken
Copy link

jeffrenken commented Jan 16, 2025

First, if you don't use --force, you get errors on some (maybe all) for React 19, but that's solved with 18.3.1. They all have the 'path' error below coming from @vxrn though.

Need to install the following packages:
[email protected]
Ok to proceed? (y) y

Hello. Let's create a new ① app...
✔ Name … one-test
✔ Template › Minimal
⠏ Creating...
one-test created!
✔ Package Manager: › npm
Installing with npm...

On npm run dev:

⇒ open web...
⓵ [ssg] http://localhost:8081/ resolved to app/index.tsx
Each child in a list should have a unique "key" prop.

Check the top-level render call using . See https://react.dev/link/warning-keys for more information.
12:13:54 PM [vite] Internal server error: The "path" argument must be of type string. Received undefined
at validateString (node:internal/validators:162:11)
at join (node:path:1175:7)
at LoadPluginContext.load (file:///Users/jeff/Code/one-test/node_modules/@vxrn/compiler/dist/esm/index.mjs:38:57)
at EnvironmentPluginContainer.load (file:///Users/jeff/Code/one-test/node_modules/vite/dist/node/chunks/dep-BJP6rrE_.js:47196:17)

I should be better with github and write and actual request. Here's a potential fix in packages/compiler/src/index.ts

import { extname, join, sep, dirname } from "node:path";
import { fileURLToPath } from "node:url";

line 59
    load: id => {
      if (id === runtimePublicPath) {
        const __dirname = dirname(fileURLToPath(import.meta.url));
        return readFileSync(join(__dirname, "refresh-runtime.js"), "utf-8");
      }
      return undefined;
    }
@christianjuth
Copy link
Contributor

You're referring to npm install --force right? If so, I noticed the same thing.

@zetavg
Copy link
Collaborator

zetavg commented Jan 19, 2025

It seems to be related to Node.js version, 20.15.0 didn't have this issue, but when I switched to 18.20.0, I could see the same error.

@jeffrenken
Copy link
Author

It seems to be related to Node.js version, 20.15.0 didn't have this issue, but when I switched to 18.20.0, I could see the same error.

Good to know! I'm on 20.10 Should've tried just changing node versions. Error does go away with the above code in node_modules/@vxrn/comiler/dist/esm/index.mjs

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

3 participants