Skip to content
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.env is in esm bundle #1679

Open
halkeye opened this issue Nov 22, 2022 · 1 comment
Open

process.env is in esm bundle #1679

halkeye opened this issue Nov 22, 2022 · 1 comment

Comments

@halkeye
Copy link

halkeye commented Nov 22, 2022

Description

When not using own bundler/transpiler, error of is thrown

process.env is in esm build output

Steps to reproduce

  1. load module dynamically (no transpiler)
    import('@docsearch/js').then(({default: docsearch}) => {
  2. click search button
  3. console log with Uncaught (in promise) ReferenceError: process is not defined

Live reproduction:

https://codesandbox.io/s/restless-meadow-osexlj?from-embed=&file=/index.html

(til, you can import() from a url)

Expected behavior

code works

Environment

  • OS: Linux
  • Browser: Chrome
  • DocSearch version: 3.3.0
@halkeye
Copy link
Author

halkeye commented Nov 22, 2022

I think it might come from https://github.com/algolia/autocomplete/blob/e81c31fbc89ad72229ed84b0318873d442ceb19b/packages/autocomplete-shared/src/warn.ts but I can't really find process.env anywhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant