@tilmannb nope, we moved our dev machines to Linux because of this.
@tilmannb and @lars Anyone or both of you have some time to work with us on tracking this down? We definitely don’t want our dev experience on Windows be broken like this!
Ohh, I did not read it properly. I see this behavior on an Apple M1 Pro with MacOS 14.5 (23F79) nodejs v20.15.0
Happy to help to fix this. I already deleted my all my node_modules folders and did a fresh yarn. But I still see the error more or less on a regular basis.
I tried to reproduce it in a fresh project via yarn create redwood-app my-redwood-project
but were not able to get the error.
So it could be be a problem that either results from the upgrade to v7 or if the project gets big enough.
I can reproduce it every time in my project if I switch from main to a different branch and then change something on the api side. @Tobbe
This is great! Means it should be easier for someone on the core team to reproduce
If it’s this easy to reproduce that’s even better!
I thought this was going to be one of those tricky Windows-only issues. And then we’d definitely need help just being able to reproduce. But from @tilmannb’s message it looks like it might be much easier than I first thought
Let me see who on the core team can take this on. Hopefully all the help we’ll need is verifying the solution I’ll get back to you all when I know more
@tobbe Maybe a “wait” from my side.
Seems like I did not remove my server.config.ts and moved my config from this file into the server.ts.
I did this and now I cannot reproduce the problem. (Very early - only a few reloads)
If I switch into the “old” branch (with server.config.ts) it still breaks.
This is not the case on our side. We did remove the old config in favour of server.ts:
When I was backtracking the upgrade to version 7 to figure out if the problem was me making a mistake during the upgrade, I tried removing the server.ts file and then I didn’t see the problem for a while.
@tilmannb @lars Do you think we could open a GitHub issue for this to centralise the description and reproduction steps? I think after that we’ll be able to tackle any issue easier.
I asked. No one volunteered to help We have a team meeting later today, I’ll make sure to bring it up again, and assign someone to it
I have identified the problem and working on a fix. I’ll post details of the problem and fix on the PR.
Some additions which occured to me while updating from 6.6.4 to 7.7.3:
Prisma Error when running yarn rw upgrade
with Node 18
Running yarn rw upgrade
as the very first step (as the upgrade guide post suggests) failed with the error stack as documented below. Updating to Node 20 first (in our case by changing the content of .nvmrc
to lts/iron
and running fnm use
) solved the issue and the upgrade ran successfully.
Upgrade failure with PrismaClientInitializationError
✔ Checking latest version
✔ Updating your Redwood version
✔ Updating /home/phil/prog/interview-tool/interviewtool/package.json
✔ Updating /home/phil/prog/interview-tool/interviewtool/api/package.json
✔ Updating /home/phil/prog/interview-tool/interviewtool/web/package.json
✔ Running yarn install
✔ Refreshing the Prisma client
⠙ De-duplicating dependencies
◼ One more thing..
/home/phil/prog/interview-tool/interviewtool/node_modules/@prisma/client/runtime/library.js:112
You may have to run ${Me("prisma generate")} for your changes to take effect.`,this.config.clientVersion);return r}}parseEngineResponse(r){if(!r)throw new B("Response from the Engine was empty",{clientVersion:this.config.clientVersion});try{return JSON.parse(r)}catch{throw new B("Unable to JSON.parse response from engine",{clientVersion:this.config.clientVersion})}}async loadEngine(){if(!this.engine){this.QueryEngineConstructor||(this.library=await this.libraryLoader.loadLibrary(this.config),this.QueryEngineConstructor=this.library.QueryEngine);try{let r=new WeakRef(this),{adapter:t}=this.config;t&&Re("Using driver adapter: %O",t),this.engine=new this.QueryEngineConstructor({datamodel:this.datamodel,env:process.env,logQueries:this.config.logQueries??!1,ignoreEnvVarErrors:!0,datasourceOverrides:this.datasourceOverrides??{},logLevel:this.logLevel,configDir:this.config.cwd,engineProtocol:"json"},n=>{r.deref()?.logger(n)},t),ja++}catch(r){let t=r,n=this.parseInitError(t.message);throw typeof n=="string"?t:new R(n.message,this.config.clientVersion,n.error_code)}}}logger(r){let t=this.parseEngineResponse(r);if(t){if("span"in t){this.config.tracingHelper.createEngineSpan(t);return}t.level=t?.level.toLowerCase()??"unknown",gm(t)?this.logEmitter.emit("query",{timestamp:new Date,query:t.query,params:t.params,duration:Number(t.duration_ms),target:t.module_path}):hm(t)?this.loggerRustPanic=new le(Hi(this,`${t.message}: ${t.reason} in ${t.file}:${t.line}:${t.column}`),this.config.clientVersion):this.logEmitter.emit(t.level,{timestamp:new Date,message:t.message,target:t.module_path})}}parseInitError(r){try{return JSON.parse(r)}catch{}return r}parseRequestError(r){try{return JSON.parse(r)}catch{}return r}onBeforeExit(){throw new Error('"beforeExit" hook is not applicable to the library engine since Prisma 5.0.0, it is only relevant and implemented for the binary engine. Please add your event listener to the `process` object directly instead.')}async start(){if(await this.libraryInstantiationPromise,await this.libraryStoppingPromise,this.libraryStartingPromise)return Re(`library already starting, this.libraryStarted: ${this.libraryStarted}`),this.libraryStartingPromise;if(this.libraryStarted)return;let r=async()=>{Re("library starting");try{let t={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.connect(JSON.stringify(t)),this.libraryStarted=!0,Re("library started")}catch(t){let n=this.parseInitError(t.message);throw typeof n=="string"?t:new R(n.message,this.config.clientVersion,n.error_code)}finally{this.libraryStartingPromise=void 0}};return this.libraryStartingPromise=this.config.tracingHelper.runInChildSpan("connect",r),this.libraryStartingPromise}async stop(){if(await this.libraryStartingPromise,await this.executingQueryPromise,this.libraryStoppingPromise)return Re("library is already stopping"),this.libraryStoppingPromise;if(!this.libraryStarted)return;let r=async()=>{await new Promise(n=>setTimeout(n,5)),Re("library stopping");let t={traceparent:this.config.tracingHelper.getTraceParent()};await this.engine?.disconnect(JSON.stringify(t)),this.libraryStarted=!1,this.libraryStoppingPromise=void 0,Re("library stopped")};return this.libraryStoppingPromise=this.config.tracingHelper.runInChildSpan("disconnect",r),this.libraryStoppingPromise}version(){return this.versionInfo=this.library?.version(),this.versionInfo?.version??"unknown"}debugPanic(r){return this.library?.debugPanic(r)}async request(r,{traceparent:t,interactiveTransaction:n}){Re(`sending request, this.libraryStarted: ${this.libraryStarted}`);let i=JSON.stringify({traceparent:t}),o=JSON.stringify(r);try{await this.start(),this.executingQueryPromise=this.engine?.query(o,i,n?.id),this.lastQuery=o;let s=this.parseEngineResponse(await this.executingQueryPromise);if(s.errors)throw s.errors.length===1?this.buildQueryError(s.errors[0]):new B(JSON.stringify(s.errors),{clientVersion:this.config.clientVersion});if(this.loggerRustPanic)throw this.loggerRustPanic;return{data:s,elapsed:0}}catch(s){if(s instanceof R)throw s;if(s.code==="GenericFailure"&&s.message?.startsWith("PANIC:"))throw new le(Hi(this,s.message),this.config.clientVersion);let a=this.parseRequestError(s.message);throw typeof a=="string"?s:new B(`${a.message}
^
PrismaClientInitializationError: error: Error validating: This line is invalid. It does not start with any known Prisma schema keyword.
--> schema.prisma:1
|
|
1 | ZGF0YXNvdXJjZSBkYiB7CiAgcHJvdmlkZXIgPSAic3FsaXRlIgogIHVybCAgICAgID0gZW52KCJEQVRBQkFTRV9VUkwiKQp9CgpnZW5lcmF0b3IgY2xpZW50IHsKICBwcm92aWRlciAgICAgID0gInByaXNtYS1jbGllbnQtanMiCiAgYmluYXJ5VGFyZ2V0cyA9ICJuYXRpdmUiCn0KCi8vIERlZmluZSB5b3VyIG93biBkYXRhbW9kZWxzIGhlcmUgYW5kIHJ1biBgeWFybiByZWR3b29kIHByaXNtYSBtaWdyYXRlIGRldmAKLy8gdG8gY3JlYXRlIG1pZ3JhdGlvbnMgZm9yIHRoZW0gYW5kIGFwcGx5IHRvIHlvdXIgZGV2IERCLgptb2RlbCBVc2VyIHsKICBpZCAgICAgICAgICAgICAgICAgIEludCAgICAgICAgIEBpZCBAZGVmYXVsdChhdXRvaW5jcmVtZW50KCkpCiAgZW1haWwgICAgICAgICAgICAgICBTdHJpbmcgICAgICBAdW5pcXVlCiAgbmFtZSAgICAgICAgICAgICAgICBTdHJpbmc/CiAgaGFzaGVkUGFzc3dvcmQgICAgICBTdHJpbmcKICBzYWx0ICAgICAgICAgICAgICAgIFN0cmluZwogIHJlc2V0VG9rZW4gICAgICAgICAgU3RyaW5nPwogIHJlc2V0VG9rZW5FeHBpcmVzQXQgRGF0ZVRpbWU/CiAgaW50ZXJ2aWV3cyAgICAgICAgICBJbnRlcnZpZXdbXQogIGNyZWF0ZWRBdCAgICAgICAgICAgRGF0ZVRpbWUgICAgQGRlZmF1bHQobm93KCkpCn0KCi8vIFNvbWUgZG9jcyBvbiByZWxhdGlvbnMgYW5kIHR5cGVzOgovLyBodHRwczovL3d3dy5wcmlzbWEuaW8vZG9jcy9jb25jZXB0cy9jb21wb25lbnRzL3ByaXNtYS1zY2hlbWEvcmVsYXRpb25zCi8vIGh0dHBzOi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IFRoaXMgaXMgYmVjYXVzZSB0aGVyZSBhcmUgc3RhbGUgSW50ZXJ2aWV3VG9rZW5bXSBub3QgY2xlYW5lZCB1cCB5ZXQgYnV0IHVudXNlZCwKICAvLyBldmVuIGZvciBvbmdvaW5nIHJvb20gc2Vzc2lvbnMKICBwYXJ0aWNpcGFudElkICAgU3RyaW5nICAgIEBkZWZhdWx0KGN1aWQoKSkKICBwYXJ0aWNpcGFudE5hbWUgU3RyaW5nPyAvLyBUT0RPOiBCZXR0ZXIgcmVhZCBmcm9tIEludGVydmlld1Rva2VuIGlmIG5lZWRlZD8KICBlZ3Jlc3NJZCAgICAgICAgU3RyaW5nPwogIGlzQWN0aXZlICAgICAgICBCb29sZWFuICAgQGRlZmF1bHQoZmFsc2UpCiAgdGFrZSAgICAgICAgICAgIEludD8gLy8gYmVnaW5zIHdpdGggMQogIGZpbGVOYW1lICAgICAgICBTdHJpbmc/IC8vIHdpdGhvdXQgZXh0ZW5zaW9uIGFuZCBwYXRoCiAgaGFzQXVkaW9UcmFjayAgIEJvb2xlYW4/ICBAZGVmYXVsdChmYWxzZSkKICBoYXNWaWRlb1RyYWNrICAgQm9vbGVhbj8gIEBkZWZhdWx0KGZhbHNlKQogIGZpbGVFeHRlbnNpb24gICBTdHJpbmc/IC8vIHdpdGhvdXQgIi4iCiAgZmlsZVNpemUgICAgICAgIEludD8gLy8gYnl0ZXMKICBkdXJhdGlvbiAgICAgICAgSW50PyAvLyBtaWxsaXNlY29uZHMKICBpc0hvc3QgICAgICAgICAgQm9vbGVhbiAgIEBkZWZhdWx0KGZhbHNlKSAvLyBUT0RPOiBSZWZlciB0byBpc3N1ZSAjMjIyCn0K
|
Validation Error Count: 1
at wt.loadEngine (/home/phil/prog/interview-tool/interviewtool/node_modules/@prisma/client/runtime/library.js:112:1018)
at async wt.instantiateLibrary (/home/phil/prog/interview-tool/interviewtool/node_modules/@prisma/client/runtime/library.js:111:12778) {
clientVersion: '5.7.0',
errorCode: 'P1012'
}
Update Yarn to latest 4.x
One will want to also upgrade the yarn version in the root package.json
to the latest 4.3 (which, at the time of writing this reply, is the specific version used since RW 7.7.0 – one should check the actual version used when upgrading):
"packageManager": "yarn@4.3.0"
For instance, RW 6.6.4 → 7.7.0 bumped it from 4.0.2 to 4.1.0, so i believe this should ideally have been included in the yarn rw upgrade
script. So for the time being, a little manual tweak does the job
Update GraphQL config
feat(gql): Codemod existing projects to get newest gql config by Tobbe · Pull Request #9959 · redwoodjs/redwood · GitHub introduced a graphql.config.js
file that includes types and gql documents support. Running yarn rw upgrade
did not update it for me, but there’s a codemod that has us covered at redwood/packages/codemods/src/codemods/v7.x.x/updateGraphQLConfig at main · redwoodjs/redwood · GitHub which can be simply run via:
npx @redwoodjs/codemods update-graphql-config
hi. i update my code from version 5 to latest version.
web | node:internal/child_process:421
web | throw new ErrnoException(err, 'spawn');
web | ^
web |
web | Error: spawn ENOTDIR
web | at ChildProcess.spawn (node:internal/child_process:421:11)
web | at Object.spawn (node:child_process:761:9)
web | at spawn (/home/alirezasattari/code/controller/node_modules/cross-spawn/index.js:12:24)
web | at crossEnv (/home/alirezasattari/code/controller/node_modules/cross-env/src/index.js:13:18)
web | at Object.<anonymous> (/home/alirezasattari/code/controller/node_modules/cross-env/src/bin/cross-env.js:5:1)
web | at Module._compile (node:internal/modules/cjs/loader:1358:14)
web | at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
web | at Module.load (node:internal/modules/cjs/loader:1208:32)
web | at Module._load (node:internal/modules/cjs/loader:1024:12)
web | at Module.require (node:internal/modules/cjs/loader:1233:19) {
web | errno: -20,
web | code: 'ENOTDIR',
web | syscall: 'spawn'
web | }
web |
web | Node.js v20.16.0
web | yarn cross-env NODE_ENV=development rw-vite-dev exited with code 1
i have this error when i run yarn rw dev
Hey @alireza There’s nothing that comes to my head immediately from just that error message sorry.
We tend to recommend updating major versions incrementally as it helps narrow down the possible issues. So in your case going from v5 → v6 → v7. Was this the approach you took or something we can try?
Disabled esbuild for netlify and that fixed it FYI.