-
Notifications
You must be signed in to change notification settings - Fork 75
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
process is not defined
error occurring when using the CDN source
#768
Comments
It seems like the problem could be easily solved by type checking like we've been doing. I'll create a PR. |
@blurfx It seems I was a bit short on context in explaining the issue. In order to make devtools work only in the development build environment, I added the condition: However, adding the condition You can verify this by installing the yorkie-js-sdk from the examples and then running devtools.
Is there a good way to resolve this? For reference, Liveblocks provides the following guidance on this issue: https://liveblocks.io/docs/platform/troubleshooting#process-not-defined |
I think we need to set environment variables or configure bundler plugin to determine the environments. Let me check it out a bit more. I'll reopen the issue until it's resolved. |
@blurfx Thanks. Currently, to avoid this issue, we've changed Devtools execution to be determined directly by users setting true/false instead of checking const doc = new yorkie.Document('docKey', {
enableDevtools: true, // Modify the condition according to your situation
}); Once this issue is resolved, it would be good to reintroduce the feature of Devtools defaulting to running only in development builds. |
What happened:
In PR#717, a Webpack configuration(
nodeEnv: false
) was added to makeprocess.env.NODE_ENV
apply in the environment where the library is used. However, this caused theprocess.env.NODE_ENV
to not be replaced with a string in the built code and remain exposed as is. Consequently, when using the CDN source, theprocess is not defined
error occurs in the browser environment.We need to investigate how to apply a different Webpack configuration to the source deployed on the CDN. (Ref: cdnjs/packages#737)
What you expected to happen:
When using the CDN source code, errors should not occur.
Devtools should be available when using the
yorkie-js-sdk.js
source, but unavailable when using theyorkie-js-sdk.min.js
source.How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
yorkie version
):The text was updated successfully, but these errors were encountered: