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

Webpack build error: unknown Statement of type "ForOfStatement" #149

Closed
AdeAttwood opened this issue Mar 14, 2023 · 0 comments
Closed

Webpack build error: unknown Statement of type "ForOfStatement" #149

AdeAttwood opened this issue Mar 14, 2023 · 0 comments
Assignees
Labels
bug Something isn't working pending release Has been merged and will be in the next release
Milestone

Comments

@AdeAttwood
Copy link
Owner

Description

When using in some webpack configurations, the @babel/plugin-transform-for-of plugin is not installed and webpack throws an error.

This is due to using the es2016 target in the typescript config. I think we should change this to es5 so the package can be used in more configurations.

Expected Behaviour

Webpack should compile successfully.

Actual Behaviour

Webpack throws the following error.

ERROR in ./node_modules/@adeattwood/react-form/lib/form.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: /src/node_modules/@adeattwood/react-form/lib/form.js: unknown Statement of type "ForOfStatement"

Steps to Reproduce the Problem

  1. Install @adeattwood/react-form in a project with a bare babel config using webpack.
  2. Use ReactForm in the application.
  3. Run webpack.
@AdeAttwood AdeAttwood added the bug Something isn't working label Mar 14, 2023
@AdeAttwood AdeAttwood added this to the 0.x milestone Mar 14, 2023
AdeAttwood added a commit that referenced this issue Mar 16, 2023
When using the package with a webpack config that dose not have the
`@babel/plugin-transform-for-of` you can get the followning error

```
unknown Statement of type "ForOfStatement"
```

Using a older syntax for the common js package should prevent this.

Ref: #149
@AdeAttwood AdeAttwood self-assigned this Mar 16, 2023
AdeAttwood added a commit that referenced this issue Mar 17, 2023
When using the package with a webpack config that dose not have the
`@babel/plugin-transform-for-of` you can get the followning error

```
unknown Statement of type "ForOfStatement"
```

Using a older syntax for the common js package should prevent this.

Ref: #149
@AdeAttwood AdeAttwood added the pending release Has been merged and will be in the next release label Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending release Has been merged and will be in the next release
Projects
None yet
Development

No branches or pull requests

1 participant