-
Notifications
You must be signed in to change notification settings - Fork 202
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
ReferenceError: process is not defined #336
Comments
Can you post the full stack trace? One of the dependencies is probably trying to dereference |
Whether you use configureStore or provideStore I wouldn't expect a change in behaviour since they use the same code under the hood. It's also interesting that it fails on your colleague's system but not on yours. This suggests that it's surfaced by some toolchain edge case. Is it possible that you have different values for Is it possible that your colleague is running the app in prod mode and you aren't? |
I faced same problem with AoT build. I tracked the problem down to Redux code, which has following checks: I was able to get around of this problem by using Rollup's Alias plugin like this: const alias = require('rollup-plugin-alias'); const config = { Hope this helps. |
For Rollup guys, I found this one which also resolves the issue: |
So yeah, defining
import replace from 'rollup-plugin-replace'
export default {
// ...
plugins: [
// ...
replace({
'process.env.NODE_ENV': JSON.stringify( 'production' )
}),
// ...
]
} For Webpack, I've done this:
// ...
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
// ...
}),
// ...
|
I am trying to use
angular-redux/store
with two enhancers:gaearon/redux-devTools
andrt2zz/redux-persist
.My project is built on https://github.com/AngularClass/angular2-webpack-starter version 5.1.1.
I was using
configureStore()
of the angular-redux but redux-persist requires that the store object be passed topersistStore(store)
and I can't access it directly from the ngRedux object (_store
is private). So I went withprovideStore()
instead.This is my code:
It build fine on my machine but not on my colleague's and not on the build server. The error thrown is the following:
Uncaught ReferenceError: process is not defined
Somehow redux crashes my build (and that's not related to
angular-redux/store
). BecauseconfigureStore
compiles OK I would like to use it, but how can I access the store object?Thanks
The text was updated successfully, but these errors were encountered: