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

Issue causing failing compilation in react #242

Open
andy1uu opened this issue Aug 17, 2023 · 1 comment
Open

Issue causing failing compilation in react #242

andy1uu opened this issue Aug 17, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@andy1uu
Copy link

andy1uu commented Aug 17, 2023

Describe the bug
Hello I keep getting this message when i try to use this in react:

Failed to compile.

SyntaxError: /Users/andyluu/repo/3d-data/d3-x3d/node_modules/d3-x3d/index.js: Support for the experimental syntax 'importAttributes' isn't currently enabled (13:55):
11 | const copyright = Copyright (C) ${year} ${author};
12 |

13 | import {default as packageJson} from "./package.json" assert { type: "json" };
| ^
14 | const version = packageJson.version;
15 | const license = packageJson.license;
16 |

Add @babel/plugin-syntax-import-attributes (https://github.com/babel/babel/tree/main/packages/babel-plugin-syntax-import-attributes) to the 'plugins' section of your Babel config to enable parsing.
at parser.next ()
at normalizeFile.next ()
at run.next ()
at transform.next ()
ERROR in ./node_modules/d3-x3d/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /Users/andyluu/repo/3d-data/d3-x3d/node_modules/d3-x3d/index.js: Support for the experimental syntax 'importAttributes' isn't currently enabled (13:55):

11 | const copyright = Copyright (C) ${year} ${author};
12 |

13 | import {default as packageJson} from "./package.json" assert { type: "json" };
| ^
14 | const version = packageJson.version;
15 | const license = packageJson.license;
16 |

To Reproduce
Steps to reproduce the behavior:
Create a React App and then install this module and try to require it somewhere in the app.js file.

Expected behavior
A clear and concise description of what you expected to happen.

@andy1uu andy1uu added the bug Something isn't working label Aug 17, 2023
@jamesleesaunders
Copy link
Owner

Thanks for the feedback and reporting this issue.
I will try and look into this alto see if I can recreate/fix.
All the best,
Jim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants