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

Why is syntax-decorators required instead of imported? #20

Open
NullVoxPopuli opened this issue Feb 20, 2024 · 1 comment · May be fixed by #27
Open

Why is syntax-decorators required instead of imported? #20

NullVoxPopuli opened this issue Feb 20, 2024 · 1 comment · May be fixed by #27

Comments

@NullVoxPopuli
Copy link

Was just browsing the code and saw:

const { default: decoratorSyntax } = req("@babel/plugin-syntax-decorators");

In particular, I was trying to use decorator-transforms in the browser, with @babel/standalone, but use of node:module does not permit this.

davidtaylorhq added a commit to davidtaylorhq/decorator-transforms that referenced this issue Apr 25, 2024
Should allow this package to be used in non-node environments. Resolves ef4#20
@davidtaylorhq davidtaylorhq linked a pull request Apr 25, 2024 that will close this issue
@davidtaylorhq
Copy link
Contributor

I was trying to use decorator-transforms in the browser

We'd also like to use decorator-transforms in a non-node environment (In our case that's mini_racer).

It looks like this node:module thing was added in 3152992 to 'fix cjs loading'. I can't claim to understand the intricacies of esm/cjs intercompatibity... but through trial & error I was able to get things working in both node and our miniracer environment via #27

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

Successfully merging a pull request may close this issue.

2 participants