Comments (26)
Note that as a workaround you can use the overrides
or resolutions
fields in package.json
.
PR welcome to set it to a range that works.
from qwik.
@wmertens, thank you for the suggestions. But I don't understand it. How overrides
or resolutions
can help when there is a syntactic problem in the qwik-auth
for auth/core
version 0.29.0
?
from qwik.
@Nefcanto it works when the versions are compatible. If not, PR welcome :)
from qwik.
@wmertens, I still don't understand. There is a syntactic problem in qwik-auth
. I wanted to run Qwik several times and I failed. I can't create a PR.
from qwik.
I opened this issue because after upgrading our codebase (which we do weekly), we realized that when we sign in to our development environment, we get 502 pages behind the authentication.
We searched and found https://community.auth0.com/t/502-error-when-hitting-auth-login/72161/10. It seems that they were using an old version.
from qwik.
@Nefcanto what is the problem in qwik-auth? You don't show the error.
And if you have trouble setting up qwik to create a PR, please do open issues for it, we want it to work easily always.
from qwik.
@Nefcanto if you just want to use a newer version without any code changes to qwik-auth, you can use the npm overrides
from qwik.
@wmertens, let me test the overrides
first, if it doesn't solve the problem I would create an issue. Is this code correct?
"overrides": {
"@builder.io/qwik": {
"@auth/core": "0.29.0"
}
}
from qwik.
@wmertens, the qwik-auth
problem was reported by our team #5783
from qwik.
Is this code correct?
Better to override for all, so that there's for sure only one instance:
"overrides": {
"@auth/core": "0.29.0"
}
or even
"overrides": {
"@auth/core": "$@auth/core"
}
so it uses the version you picked
from qwik.
@wmertens, thank you so much. Let me test it. I'll come back with the results.
from qwik.
@wmertens, This is my package.json
:
{
"name": "qwik",
"engines": {
"node": ">=15.0.0"
},
"private": true,
"trustedDependencies": [
"sharp"
],
"type": "module",
"scripts": {
"build": "qwik build",
"build.client": "vite build",
"build.preview": "vite build --ssr src/entry.preview.tsx",
"build.server": "vite build -c adapters/express/vite.config.js",
"build.types": "tsc --incremental --noEmit",
"deploy": "node server/entry.express",
"dev": "vite --mode ssr --clearScreen false",
"dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
"fmt": "prettier --write .",
"fmt.check": "prettier --check .",
"lint": "eslint \"src/**/*.ts*\"",
"preview": "qwik build preview && vite preview",
"serve": "node server/entry.express",
"start": "vite --mode ssr",
"qwik": "qwik"
},
"devDependencies": {
"@builder.io/partytown": "^0.10.1",
"@builder.io/qwik": "^1.5.2",
"@builder.io/qwik-auth": "^0.1.3",
"@builder.io/qwik-city": "^1.5.2",
"@modular-forms/qwik": "^0.23.1",
"@tailwindcss/typography": "^0.5.12",
"@types/compression": "^1.7.5",
"@types/cors": "^2.8.16",
"@types/eslint": "^8.56.7",
"@types/express": "^4.17.21",
"@types/node": "^20.12.7",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"acorn": "^8.11.3",
"acorn-jsx": "^5.3.2",
"autoprefixer": "^10.4.17",
"compression": "^1.7.4",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"escodegen": "^2.1.0",
"eslint": "^9.0.0",
"eslint-plugin-qwik": "^1.5.2",
"estraverse": "^5.3.0",
"express": "^4.19.2",
"nightly-esprima": "^2021.8.30",
"node-fetch": "^3.3.1",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5",
"undici": "^6.12.0",
"valibot": "^0.30.0",
"vite": "^5.2.8",
"vite-tsconfig-paths": "^4.3.2"
},
"dependencies": {
"axios": "^1.6.5",
"chart.js": "^4.4.2",
"glider-js": "^1.7.8",
"leaflet": "^1.9.4",
"prismjs": "^1.29.0",
"swiper": "^11.1.1",
"tailwind-merge": "^2.2.1"
},
"overrides": {
"@auth/core": "$@auth/core"
}
}
And now I get these errors:
[vite] Pre-transform error: Failed to load url @auth/core/providers/keycloak (resolved id: @auth/core/providers/keycloak) in /Project/SiteQwik/src/routes/[email protected]. Does the file exist?
[vite] Pre-transform error: Failed to load url @auth/core (resolved id: @auth/core) in /Base/Site/node_modules/@builder.io/qwik-auth/lib/index.qwik.mjs. Does the file exist?
And when I went into the node_modules
directory, I realized that no @auth/core
directory exists there. What can be the problem?
from qwik.
Looks like the api changed since 0.21, and someone needs to update qwik-auth for it.
BTW, none of your dependencies are actual dependencies that your server needs in production, they should all be devDependencies.
from qwik.
oh and you don't have @auth/core in your devDependencies, so it's not installed maybe? You need to add it
from qwik.
Looks like the api changed since 0.21, and someone needs to update qwik-auth for it.
BTW, none of your dependencies are actual dependencies that your server needs in production, they should all be devDependencies.
That's why I asked for this upgrade. The API is changed since 0.21.0
. But this change might be a simple one.
And about dependencies, we do need to use axios for our client code. Or Chart.js to render charts. I don't understand how you say that they are not used in production.
from qwik.
oh and you don't have @auth/core in your devDependencies, so it's not installed maybe? You need to add it
It was there. I removed it. You guided me to use overrides
. Should I add it in two places? Both in overrides
and devDependnecies
? And should I also consider adding the same version in both places?
from qwik.
This is my new package.json
:
{
"name": "qwik",
"engines": {
"node": ">=15.0.0"
},
"private": true,
"trustedDependencies": [
"sharp"
],
"type": "module",
"scripts": {
"build": "qwik build",
"build.client": "vite build",
"build.preview": "vite build --ssr src/entry.preview.tsx",
"build.server": "vite build -c adapters/express/vite.config.js",
"build.types": "tsc --incremental --noEmit",
"deploy": "node server/entry.express",
"dev": "vite --mode ssr --clearScreen false",
"dev.debug": "node --inspect-brk ./node_modules/vite/bin/vite.js --mode ssr --force",
"fmt": "prettier --write .",
"fmt.check": "prettier --check .",
"lint": "eslint \"src/**/*.ts*\"",
"preview": "qwik build preview && vite preview",
"serve": "node server/entry.express",
"start": "vite --mode ssr",
"qwik": "qwik"
},
"devDependencies": {
"@auth/core": "$@auth/core",
"@builder.io/partytown": "^0.10.1",
"@builder.io/qwik": "^1.5.2",
"@builder.io/qwik-auth": "^0.1.3",
"@builder.io/qwik-city": "^1.5.2",
"@modular-forms/qwik": "^0.23.1",
"@tailwindcss/typography": "^0.5.12",
"@types/compression": "^1.7.5",
"@types/cors": "^2.8.16",
"@types/eslint": "^8.56.7",
"@types/express": "^4.17.21",
"@types/node": "^20.12.7",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/parser": "^7.6.0",
"acorn": "^8.11.3",
"acorn-jsx": "^5.3.2",
"autoprefixer": "^10.4.17",
"compression": "^1.7.4",
"cors": "^2.8.5",
"dotenv": "^16.4.5",
"escodegen": "^2.1.0",
"eslint": "^9.0.0",
"eslint-plugin-qwik": "^1.5.2",
"estraverse": "^5.3.0",
"express": "^4.19.2",
"nightly-esprima": "^2021.8.30",
"node-fetch": "^3.3.1",
"postcss": "^8.4.35",
"prettier": "^3.2.5",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5",
"undici": "^6.12.0",
"valibot": "^0.30.0",
"vite": "^5.2.8",
"vite-tsconfig-paths": "^4.3.2"
},
"dependencies": {
"axios": "^1.6.5",
"chart.js": "^4.4.2",
"glider-js": "^1.7.8",
"leaflet": "^1.9.4",
"prismjs": "^1.29.0",
"swiper": "^11.1.1",
"tailwind-merge": "^2.2.1"
},
"overrides": {
"@auth/core": "$@auth/core"
}
}
And this is the error I get:
[vite] Pre-transform error: Failed to load url @auth/core/providers/keycloak (resolved id: @auth/core/providers/keycloak) in /Project/SiteQwik/src/routes/[email protected]. Does the file exist?
[vite] Pre-transform error: Failed to load url @auth/core (resolved id: @auth/core) in /Base/Site/node_modules/@builder.io/qwik-auth/lib/index.qwik.mjs. Does the file exist?
Just the same as before. And this is the result of npm list @auth/core
:
root@site:/Project/SiteQwik# npm list @auth/core
npm ERR! code ELSPROBLEMS
npm ERR! invalid: @auth/core@ /Project/SiteQwik/node_modules/@auth/core
qwik@ /Project/SiteQwik
+-- @auth/core@ invalid: "$@auth/core" from the root project overridden
`-- @builder.io/[email protected]
`-- @auth/core@ deduped invalid: "$@auth/core" from the root project, "$@auth/core" from node_modules/@builder.io/qwik-auth
from qwik.
Could you offer a minimal reproduction?
from qwik.
@JerryWu1234, with respect, I think there is no need for an MRE. @auth/core
has released many versions newer than 0.21.0
and sooner or later qwik-auth
should follow. In fact [0.21.0] is released three months ago.
from qwik.
Related Issues (20)
- [🐞] the qwik CLI should not clear the console history HOT 1
- Redirects Not Working [🐞]
- [🐞] Extremely unpleasant jumps and flashes for a simple HTML input HOT 5
- [🐞] onPost not working properly
- [🐞] Getting props/restProps inside component$() and turning them into signal doesn't seem to work like expected. HOT 1
- [🐞] Firefox: navigator.serviceWorker is undefined HOT 2
- [✨] Update your template to include eslint.config.js by default HOT 2
- [🐞] plugin:vite:esbuild] [plugin vite:esbuild] src/components/router-head/router-head.tsx: Duplicate key "dangerouslySetInnerHTML" HOT 3
- [🐞] SSG in fresh project not working HOT 2
- There are some tests is weird [🐞] HOT 2
- [✨] use modulepreload if supported
- [✨] Remove the initial lag for `useAuthSignin` HOT 1
- Modular Forms input loses focus when projected [🐞] HOT 1
- [🐞]
- [🐞] prisma integration HOT 1
- [🐞] Weird behavior when accessing props value in differents way HOT 2
- Probably meant the mdx HOT 1
- [✨] Add the `unwrapProxy` as a Low-Level API HOT 1
- [📖] Hooks Cookbook HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qwik.