Install from npm the built file is not compiled to es5.
See original GitHub issueDescribe the bug
Just install the npm pkg, the files inside lib
folder is not compatible into es5… I can see import
etc syntax in lib folder.
node_modules/restful-react/lib/index.js:1
(function (exports, require, module, __filename, __dirname) { import Get from "./Get";
^^^
SyntaxError: Unexpected identifier
at new Script (vm.js:74:7)
at createScript (vm.js:246:10)
at Object.runInThisContext (vm.js:298:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
To Reproduce just install from npm.
Expected behavior Should work in browsers
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (10 by maintainers)
Top Results From Across the Web
npm module should be precompiled to ES5 #7850 - GitHub
I edit the ES6+ source code and reload the app. One thing that's especially important is that the code is not stale. With...
Read more >Webpack not converting ES6 to ES5 - node.js - Stack Overflow
So I did some research and I found babel-loader. However, I'm not sure what I'm doing. I ran npm install babel-loader --save-dev and...
Read more >JavaScript needs the compile step (on install) - Gleb Bahmutov
We all pretend that JavaScript is unique because it does not require a build or compile step on the client. Yet, this is...
Read more >are-you-es5 - npm
A package to help you find out which of your `node_modules` aren't ES5 so you can add them to your transpilation steps.
Read more >Compile and build TypeScript code using npm - Microsoft Learn
For a Node.js project, you can install the TypeScript npm package using the command line or the IDE. To install using the IDE,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found a workaround of this issue in nextjs, I’m in a tight deadline for our project. I don’t have time to dig in further codebases. However, I’ll create PRs for features and fixes of
restful-react
if needed for my use case, thanks.Totally agree to introduce rollup and
--target es5
orbuild --for umd
. We already have an open issue for this https://github.com/contiamo/operational-scripts/issues/20 😉