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

resolveRoute usage has warning in the console in prod mode #1423

Closed
beneschjozsef opened this issue Jan 10, 2024 · 4 comments
Closed

resolveRoute usage has warning in the console in prod mode #1423

beneschjozsef opened this issue Jan 10, 2024 · 4 comments
Labels

Comments

@beneschjozsef
Copy link

Description

I did it the v1 design migration. I have this warning in the console, because of this import in the +route.jsx: 'import { resolveRoute } from 'vike/routing''

in this file I found TODO comment: node_modules/vike/dist/esm/shared/route/routing.js
// TODO/v1-release - move:
// import { resolveRoute } from 'vike/routing'
// to:
// import { resolveRoute } from 'vike'

I tried the import { resolveRoute } from 'vike' import too, which not working yet.

assert.js?v=5d3e7c2c:23 Error: [vike][Warning] You shouldn't `import { something } from 'vike/client/router'` when using Server Routing. The 'vike/client/router' utilities work only with Client Routing. In particular, don't `import { navigate }` nor `import { prefetch }` as they unnecessarily bloat your client-side bundle sizes.
    at assertWarning (assert.js?v=5d3e7c2c:94:21)
    at assertNoContradiction (assertRoutingType.js?v=5d3e7c2c:23:5)
    at assertServerRouting (assertRoutingType.js?v=5d3e7c2c:17:5)
    at entry.js:2:1
@brillout
Copy link
Member

Indeed I could reproduce, let me have a look.

@brillout
Copy link
Member

Fix pre-released in 0.4.156-commit-b89a01a.

Btw. would your company be up for sponsoring?

@beneschjozsef
Copy link
Author

Thanks! I will tell my manager.

@brillout
Copy link
Member

Thanks, we'd massively appreciate it. Let us know how it goes 👀

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

2 participants