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

vConsole is failing in Next.js app router #189

Open
5 of 6 tasks
kristofferso opened this issue Jan 24, 2024 · 6 comments
Open
5 of 6 tasks

vConsole is failing in Next.js app router #189

kristofferso opened this issue Jan 24, 2024 · 6 comments
Labels
untriaged Newly reported issue

Comments

@kristofferso
Copy link

kristofferso commented Jan 24, 2024

Describe the bug 💬

When running a Next.js project with the app router in dev I get the following error when reloading the page on mobile or when the browser simulates a mobile. I suspect it's because vConsole only loads when the screen size is less than a certain amount.

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length')
    at vconsole.min.js:10:221845

Next.js version 14.0.3

Operating System 👩‍💻

macOS

What browsers are you seeing the problem on? 🏄‍♂️

Chrome

Editor Version 🎲

2020.3

Needle Exporter version

3.31

Project Info (Unity only) 📜

No response

Steps to reproduce 🔢

1. Run `npm run dev`
2. Enter device preview mobile from developer console
3. Refresh page
4. See that the scene is stuck at loading because vconsole fails
...

Reproduction ♻

No response

Discord or Discussion link

No response

Validations 🩹

@kristofferso kristofferso added the untriaged Newly reported issue label Jan 24, 2024
@marwie
Copy link
Member

marwie commented Jan 24, 2024

Do you see this error in vconsole? Can you check the stacktrace? The error might be misleading

@kristofferso
Copy link
Author

kristofferso commented Jan 24, 2024

No I can't see anything in vconsole because it doesn't load.

The stack trace is just 60+ repeats of:

Promise.then (async)
readData @ three.module.js:42216
eval @ three.module.js:42235

Any ideas?

@marwie
Copy link
Member

marwie commented Jan 24, 2024

Is it the same in the regular browser console? Can you see what is evaluated there? (Since you said it also happens in e.g. chrome with mobile emulation)

@kristofferso
Copy link
Author

This is from the browser console. The virtual console doesn't load. The same error happens in your Next.js starter project.

@marwie
Copy link
Member

marwie commented Jan 26, 2024

Hi, I just tried with our template and I don't get the error there
Do you refer to a different starter project?

@kristofferso
Copy link
Author

Right, I should have specified in my last comment that this is for the app router. I made a fork of the repo that reproduces the error: https://github.com/kristofferso/needle-test/tree/main/src

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

No branches or pull requests

2 participants