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

Could not resolve "vike-react/config" [plugin vike-esbuild] #1729

Closed
jordyalcides opened this issue Jul 3, 2024 · 27 comments
Closed

Could not resolve "vike-react/config" [plugin vike-esbuild] #1729

jordyalcides opened this issue Jul 3, 2024 · 27 comments
Labels

Comments

@jordyalcides
Copy link

Description

Describe the bug
After starting a new project with the command pnpm create @batijs/app --react, installing dependencies and running dev mode the console shows an error
[vike][config] Failed to transpile /pages/+config.ts because:
✘ [ERROR] Could not resolve "vike-react/config" [plugin vike-esbuild]

To Reproduce
Steps to reproduce the behavior, run the following commands in order:
pnpm create @batijs/app --react
cd my-app
pnpm i && pnpm run dev

Expected behavior
Run dev mode without any errors

Screenshots
Screenshot 2024-07-03 at 17 53 27

Additional context
Using macOS Ventura 13.6.6, also I have updated node, pnpm, typescript and all libs versions to match the versions on stackblitz demo (which I know works), still the problem persists. I also tried installing the dependencies from the stackblitz lockfile.

@brillout
Copy link
Member

brillout commented Jul 4, 2024

I cannot reproduce. What's your Node.js version?

@jordyalcides
Copy link
Author

node version: v18.20.3
pnpm version: 9.4.0

@brillout
Copy link
Member

brillout commented Jul 4, 2024

Does it work with a newer Node.js version such as Node 20?

@jordyalcides
Copy link
Author

also no, just tried it

@brillout
Copy link
Member

brillout commented Jul 4, 2024

Hm, I cannot reproduce with:

pnpm create @batijs/app --react
cd my-app
pnpm i && pnpm run dev

Then go to http://localhost:3000, see the page, then click on the counter. No errors at all.

node -v
v20.12.2
pnpm -v
9.4.0

@jordyalcides
Copy link
Author

here with the error the page just doesn't load, the file it is failing to transpile is the vike-react configs

@brillout
Copy link
Member

brillout commented Jul 4, 2024

You're the only one reporting this issue, so I'm inclined to think it's some kind of issue with your setup? Are you doing something unusual?

@magne4000
Copy link
Member

Someone had the exact same issue not so long ago https://discord.com/channels/1105779924658303058/1125707822705938454/1249389970636931264

We didn't find what was wrong, but it seems to work when using yarn... 🤷

@jordyalcides
Copy link
Author

I also asked other people to try and it only happens here, I'm inclined to think it may have something to do with my version of typescript, but i tried other version and nothing changes

@jordyalcides
Copy link
Author

Someone had the exact same issue not so long ago https://discord.com/channels/1105779924658303058/1125707822705938454/1249389970636931264

We didn't find what was wrong, but it seems to work when using yarn... 🤷

I will try with yarn

@brillout
Copy link
Member

brillout commented Jul 4, 2024

👍 Keep us updated, would be nice to get to the bottom of this 👀

@jordyalcides
Copy link
Author

I tried with yarn and no success.
Also I remove all my package managers, nvm and node itself, purged everything and made a clean install from the zero and I am still getting the same error.

@brillout
Copy link
Member

brillout commented Jul 4, 2024

Hm, I ain't sure how I can debug this without a reproduction.

I guess the only thing left we can do here is for you to dig into the code... in case you're up for it:

@brillout
Copy link
Member

brillout commented Jul 4, 2024

What's your $ pwd? Maybe your path contains some unusual character?

@jordyalcides
Copy link
Author

What's your $ pwd? Maybe your path contains some unusual character?

/Users/jordy/projects/wisefy-repos/moonpass-io/my-app

doesnt seem to have anything unusual

@brillout
Copy link
Member

brillout commented Jul 4, 2024 via email

@jordyalcides
Copy link
Author

I tried two things that worked successfuly:

  • Running the project in a Dockerfile
  • Running the project with a new user

it seems that something is up with my user, and I don't know what could be.
I tried hard deleting any pnpm caches I found on the normal path, but no success.

@jordyalcides
Copy link
Author

I tried using the absolute path for the config file inside the node_modules and I get this error:

Screenshot 2024-07-04 at 12 48 12

not sure if it rings any bells to you, but I will try to dig into the code as you suggested

@magne4000
Copy link
Member

Something to do with your environment variables perhaps?

@brillout
Copy link
Member

brillout commented Jul 4, 2024 via email

@jordyalcides
Copy link
Author

Something to do with your environment variables perhaps?

not sure since only one import is giving any errors so far

@brillout
Copy link
Member

brillout commented Jul 5, 2024

@jordyalcides Actually, if you provide the debug logs DEBUG=vike:pointer-imports pnpm run dev then this would be very insightful, this may very well give the information I need to further debug this.

@brillout
Copy link
Member

brillout commented Jul 9, 2024

I'll re-open once I get more information.

@brillout brillout closed this as not planned Won't fix, can't repro, duplicate, stale Jul 9, 2024
@brillout
Copy link
Member

brillout commented Jul 9, 2024

I've a couple of ideas how we can debug this, so definitely let me know if someone else runs into this issue.

@jordyalcides Let me know if you're still interested in trying to debug this.

@jordyalcides
Copy link
Author

Sorry, I got caught up at work, we are using vike on this new project here, so I created a new profile on my mac to speed up things, but I still want to understand what is going wrong.

I also bumped into a new bug here using the vike-react-query plugin, just reported it.

@jordyalcides
Copy link
Author

@jordyalcides Actually, if you provide the debug logs DEBUG=vike:pointer-imports pnpm run dev then this would be very insightful, this may very well give the information I need to further debug this.

I will let you know as soon as I try it here

@brillout
Copy link
Member

brillout commented Jul 9, 2024

👍 Looking forward to it.

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

No branches or pull requests

3 participants