-
-
Notifications
You must be signed in to change notification settings - Fork 190
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
Packages error - 'process is not defined' #225
Comments
Your issue is due to send being a package which is meant to stream files from the filesystem of a server to a client. The APIs it relies on to do so are Node specific, and not available in the browser where your angular client is running. |
Understood! Thanks for the clarification!
Any idea on how to solve it? Or should I open an issue in any other package repo? |
I'm having the same issue, my project was working correctly in the last days but today when I runned the project it broken. Any solution ? @gabriGutiz @jonchurch |
I'm getting the same error. Any solution? @gabriGutiz @jonchurch |
I haven't seen anything which indicates this error is coming from using the package as intended. If you can create a minimum repro then please open a new isue with a reproducible example I can run. There have been no changes to this package which would introduce this error, so I do not expect it to be an issue with send but instead an issue of using the package in a browser where Node's locking |
Sorry for the late response! I recreated the error in this repo, in the main branch the error occurs and in the problem-solved branch, the error is solved. The file auth.services.ts inside core module is the one creating the error when the @core (a path created) is imported inside app.route.ts. I didn´t really understood this error, but like @jonchurch said I don´t believe this is a send package error. Hope this helps, @rogigs and @mirazib71! |
After adding implementation for canActivate in angular routing, the following errors started:
Uncaught ReferenceError: process is not defined
For that I found two "solutions":
1 Add this code as script to index.html file:
<script>window.process = { env: { NODE_ENV: 'production' } };</script>
That I don't really like
2 Add a polyfill.ts file:
Both solutions gives me the error:
Uncaught TypeError: util.inherits is not a function
That I wasn't able to solve.
I have no ideia what is happening and I could not find any solution in the internet. I tested the CanActivateFn and is working fine, but the non authenticated page gives me the errors described.
For context, this is my app.routes.ts:
When going to root page being not authenticated the described errors occur.
I'm using Angular 17, node 20.11.1 and send 0.18.0.
The text was updated successfully, but these errors were encountered: