davidhu2000 / react-spinners

A collection of loading spinner components for react
https://www.davidhu.io/react-spinners
MIT License
3.03k stars 263 forks source link

Error while running test #445

Closed maxizhukov closed 2 years ago

maxizhukov commented 3 years ago

Describe the bug I have a Syntax error while running test in repository, my test files are empty and only initial test file from CRA But I get this error:

SyntaxError: /opt/atlassian/pipelines/agent/build/node_modules/react-spinners/PropagateLoader.js: pragma and pragmaFrag cannot be set when runtime is automatic.

1 | "use strict"; | ^ 2 | var makeTemplateObject = (this && this.makeTemplateObject) || function (cooked, raw) { 3 | if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 4 | return cooked; at File.buildCodeFrameError (node_modules/@babel/core/lib/transformation/file/file.js:250:12) at NodePath.buildCodeFrameError (node_modules/@babel/traverse/lib/path/index.js:133:21) at PluginPass.enter (node_modules/@babel/plugin-transform-react-jsx/lib/create-plugin.js:164:28) at newFn (node_modules/@babel/traverse/lib/visitors.js:171:21) at NodePath._call (node_modules/@babel/traverse/lib/path/context.js:53:20) at NodePath.call (node_modules/@babel/traverse/lib/path/context.js:40:17) at NodePath.visit (node_modules/@babel/traverse/lib/path/context.js:90:31) at TraversalContext.visitQueue (node_modules/@babel/traverse/lib/context.js:99:16) at TraversalContext.visitSingle (node_modules/@babel/traverse/lib/context.js:73:19) at TraversalContext.visit (node_modules/@babel/traverse/lib/context.js:127:19)

Additional context "react-spinners": "^0.10.6", "react-dom": "^16.14.0", "react": "^16.14.0",

esetnik commented 3 years ago

I have the same issue. I believe we need to add

/** @jsxRuntime classic */

to the top of the source files

esetnik commented 3 years ago

I believe it's also related to https://github.com/davidhu2000/react-spinners/issues/430

davidhu2000 commented 2 years ago

https://github.com/system-ui/theme-ui/issues/1160

a similar issue. need to think about how to do this. classic runtime will probably work

davidhu2000 commented 2 years ago

@maxizhukov can you update to 0.12.0-alpha.2 and see if this issue is resolved. I just merged a fix for the jsx runtime issue

451

FlorianBurgevin commented 2 years ago

Hello. It's OK for me with this version

davidhu2000 commented 2 years ago

Version 0.12.0 is released