-
Notifications
You must be signed in to change notification settings - Fork 97
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. |
@chacha912 It's been a few months since |
@blurfx Yes, I think it's still a good idea. Having devtools enabled by default in the development environment would likely make the development process more convenient. (The |
@chacha912 then I'll work on enabling devtools by default in the development environment, and optionally using the |
@blurfx @chacha912 Thanks for your interest in this issue. JS SDK provides two installation methods, and developers can either import it as an npm module or include it directly on their web pages using a CDN link. https://yorkie.dev/docs/getting-started/with-js-sdk#setup When using the SDK via npm, we have the ability to control devtools activation based on whether it's a development or production build, typically using the However, when the SDK is included directly via CDN, there's no build process involved. We need to consider this case, find the good way to enable devtools in this scenario. Also, be careful to avoid script errors caused by |
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: