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

fix: export module error #683

Merged
merged 1 commit into from
Aug 29, 2024
Merged

fix: export module error #683

merged 1 commit into from
Aug 29, 2024

Conversation

PatrykKuniczak
Copy link
Collaborator

* Please fill in the required items.

Priority*

  • High: This PR needs to be merged first for other tasks.
  • Middle: This PR should be merged quickly to prevent conflicts due to common changes. (default)
  • Low: This PR does not affect other tasks, so it can be merged later.

Purpose of the PR*

On the #682 i changed this value, because one person from discord suggest it, but it isn't good idea, because i see a part of pages don't work properly, we need to change it immediately.

Changes*

I removed module from tsconfig

This it very urgent :)

@Jonghakseo Jonghakseo merged commit 925a6b4 into main Aug 29, 2024
5 checks passed
@Jonghakseo Jonghakseo deleted the fix/console-module-error branch August 29, 2024 23:53
@akshaycj
Copy link

akshaycj commented Sep 3, 2024

Removing the module brings back the below error:
The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'
@PatrykKuniczak is there any work around for this?

@PatrykKuniczak
Copy link
Collaborator Author

@akshaycj I've figured it out, a minutes ago XD

I need to take a look on that, i've placed it on my TODO list, i'll fixed it ASAP :)

@akshaycj
Copy link

akshaycj commented Sep 3, 2024

@PatrykKuniczak quick question, what parts of the extension are affected when module is added? just curious.

@PatrykKuniczak
Copy link
Collaborator Author

@akshaycj If my brain works well, that's probably content-ui i really doesn't remember, i need to take a look.

Maybe that's conflict with sth else, and it distract me, and the solution could be to rollback this PR.

@PatrykKuniczak
Copy link
Collaborator Author

@akshaycj Sth like that ocurr:

image

I don't want to struggle with this, i'll create new package for handle all env and simplify it for users 🔥

@paluchi
Copy link

paluchi commented Sep 11, 2024

I'm struggling a lot with this

@PatrykKuniczak
Copy link
Collaborator Author

PatrykKuniczak commented Sep 11, 2024

I'm struggling a lot with this

I'm currently working on new solution, i have som bash script for automatization and now process.env have all envs including this from CLI.

But i can't use process in browser.
I need to create additional object which takes all process values which will work either on server(node) and on browser.

Be pacient, we'll merge it ASAP 😄

@paluchi
Copy link

paluchi commented Sep 12, 2024

I'm struggling a lot with this

I'm currently working on new solution, i have som bash script for automatization and now process.env have all envs including this from CLI.

But i can't use process in browser. I need to create additional object which takes all process values which will work either on server(node) and on browser.

Be pacient, we'll merge it ASAP 😄

That's awesome to know, thank you very much @PatrykKuniczak

@PatrykKuniczak
Copy link
Collaborator Author

@paluchi But I'm verrryyy stuck with 1 think and we all were stuck, but i hope i'll do it in this week :)
It depends if @Jonghakseo are able to fix this issue 😆

@Jonghakseo
Copy link
Owner

Jonghakseo commented Sep 12, 2024

@paluchi @PatrykKuniczak

Maybe it works for us.

@paluchi
Copy link

paluchi commented Sep 13, 2024

@Jonghakseo @PatrykKuniczak At least from my side I can say you are helping a lot of people fixing this issue. I'm trying to centralize envs in a .ts file under packages directory but It seems not to work with process.env nor import.meta.env.{YOUR_KEY}

@zirho
Copy link

zirho commented Sep 21, 2024

I had to remove this line to get it working
https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite/blob/main/packages/tsconfig/utils.json#L8

but even then, I get ts error saying

Property 'env' does not exist on type 'ImportMeta'.ts(2339)
image

Let me try to fix this.

@zirho
Copy link

zirho commented Sep 21, 2024

it turned out that it refers to ImportMeta in this file
node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts
copying vite-env.d.ts into the package that uses import.meta.env works for me.
Thank you!

so basically,

  1. add tsconfig.json in compilerOptions
    "module": "ESNext",
  1. copy vite-env.d.ts file in the package.

@PatrykKuniczak
Copy link
Collaborator Author

it turned out that it refers to ImportMeta in this file node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/lib.dom.d.ts copying vite-env.d.ts into the package that uses import.meta.env works for me. Thank you!

so basically,

  1. add tsconfig.json in compilerOptions
    "module": "ESNext",
  1. copy vite-env.d.ts file in the package.

I'll do it to work everywhere good, but after we merge #711 :)
Thanks for your temporary solution

@paluchi
Copy link

paluchi commented Sep 26, 2024

Hi @PatrykKuniczak. Is there any time estimate for the resolution of this problem?

@PatrykKuniczak
Copy link
Collaborator Author

Hi @PatrykKuniczak. Is there any time estimate for the resolution of this problem?

It depends on @Jonghakseo time, because i have been waiting for code review

@paluchi
Copy link

paluchi commented Oct 2, 2024

Hi @PatrykKuniczak @Jonghakseo Do we have any news regarding this problem?

@PatrykKuniczak
Copy link
Collaborator Author

Hi @PatrykKuniczak @Jonghakseo Do we have any news regarding this problem?

We have no time

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

Successfully merging this pull request may close these issues.

5 participants