We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
While using esBuild, I expect to add:
import DailyIframe from "@daily-co/daily-js"
without a problem
esBuild succeeds in building the react app, but when loading in the browser, yields "Uncaught ReferenceError: global is not defined" in the console.
The solution is to define global=window in esBuild's build configs.
https://esbuild.github.io/api/#define
In a build script:
esbuild.build({ ...other build configs define: { global: "window" } })
in the command line, add --define:global=window
--define:global=window
Mention this in the https://docs.daily.co/reference#using-the-dailyco-front-end-library
under the section for "Bundling with webpack and other tools"
The text was updated successfully, but these errors were encountered:
I got the same problem when using Vite
In order to resolve it I had to add the following to vite.config.ts:
vite.config.ts
export default defineConfig({ define: { global: 'window', }, })
More info can be found at https://vitejs.dev/config/#define
Sorry, something went wrong.
I got the same problem when using Vite In order to resolve it I had to add the following to vite.config.ts: export default defineConfig({ define: { global: 'window', }, }) More info can be found at https://vitejs.dev/config/#define
This resolved the issue for me as well using Vite
Also hit this.
Please use 'esbuild-plugin-polyfill-node' plugin. https://npm.io/package/esbuild-plugin-polyfill-node
plugins: [ polyfillNode({ }), ]
This solved the problem for me.
No branches or pull requests
Expected behavior
While using esBuild, I expect to add:
import DailyIframe from "@daily-co/daily-js"
without a problem
Describe the bug (unexpected behavior)
esBuild succeeds in building the react app, but when loading in the browser, yields "Uncaught ReferenceError: global is not defined" in the console.
Steps to reproduce
The solution is to define global=window in esBuild's build configs.
https://esbuild.github.io/api/#define
In a build script:
in the command line, add
--define:global=window
Action to take
Mention this in the https://docs.daily.co/reference#using-the-dailyco-front-end-library
under the section for "Bundling with webpack and other tools"
The text was updated successfully, but these errors were encountered: