-
Notifications
You must be signed in to change notification settings - Fork 9
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
Cannot read properties of undefined (reading 'replace') when using GO module #169
Comments
Hey, thank you for reporting the issue. I've created a reproduction at https://github.com/primatejs/issues/tree/169 which includes a simple Go route that returns plaintext. You can run it with
Browsing to The faulty route error (which fails to display here -- will investigate why) could indicate that primate cannot find Go in path, which it needs to compile routes. Does If this is not a problem of Go itself missing, could you send a small PR against this branch with the reproducible error? You might be doing something different in your Go route. |
Thank you for the very quick reply @terrablue! I have just tried running the reproduction you've made. Unfortunately this results in the samme error as before for me. To be absolutely sure, I have run this on both my private (MacBook) and my workstation (Both in Windows and WSL) - same error on all three. Here's the output from running the command you gave: $ git clone -b 169 https://github.com/primatejs/issues && cd issues && npm install && npx primate
Cloning into 'issues'...
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 14 (delta 1), reused 13 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (14/14), done.
Resolving deltas: 100% (1/1), done.
added 33 packages, and audited 34 packages in 9s
1 package is looking for funding
run `npm fund` for details
found 0 vulnerabilities
primate 0.32.6
++ starting web build in development mode
file:///Users/**/sandbox/issues/node_modules/@primate/core/src/private/mark.js:4
formatted.replace(`{${i}}`, bold(param)), format);
^
TypeError: Cannot read properties of undefined (reading 'replace')
at file:///Users/**/sandbox/issues/node_modules/@primate/core/src/private/mark.js:4:13
at Array.reduce (<anonymous>)
at default (file:///Users/**/sandbox/issues/node_modules/@primate/core/src/private/mark.js:3:46)
at make_error (file:///Users/**/sandbox/issues/node_modules/@primate/core/src/private/log.js:23:8)
at normalize (file:///Users/**/sandbox/issues/node_modules/@primate/core/src/private/log.js:31:5)
at Object.error (file:///Users/**/sandbox/issues/node_modules/@primate/core/src/private/log.js:59:20)
at default (file:///Users/**/sandbox/issues/node_modules/@primate/go/src/private/error/faulty-route.js:5:35)
at Object..go (file:///Users/**/sandbox/issues/node_modules/@primate/go/src/private/build.js:170:7)
at async post (file:///Users/**/sandbox/issues/node_modules/@primate/core/src/build/hook/build.js:128:5)
at async file:///Users/**/sandbox/issues/node_modules/@primate/core/src/build/index.js:41:3
Node.js v20.18.0
$ go version
go version go1.21.0 darwin/arm64 |
@JoakimMellonn I just published On Windows, it might take a while since I don't know a standardised way to query an application's path (like |
or windows |
@JoakimMellonn I just published |
When trying to use the Go module for having a backend in go, I'm getting the following error when running the app. This is a problem with a newly setup app.
Steps for reproduction
The text was updated successfully, but these errors were encountered: