question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when compiling with rollup babel

See original GitHub issue

Hello,

I’m trying to import lory.js with rollup babel but it’s crashing in a number of places.

This is my task: https://gist.github.com/magicspon/db9b427b778b54b122502a950970e057

The first error is as follows: SyntaxError: Unexpected token (214:19) in /Users/stockley/websites/snapldn/node_modules/lory.js/src/lory.js

options = {...defaults, ...opts};

It looks like lory.js is not being transpiled.

Has anyone had any issues importing lory. (It works perfectly with browserify).

Thanks Dave

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mahishcommented, Feb 25, 2018

It was easier than expected, here it is: https://github.com/mahish/lory/tree/build-with-rollup . I deleted all packages. Then installed via npm:

"scripts": {
    "start": "npm install && npm run dev",
    "dev": "rollup -c -w -m inline",
    "build": "rollup -c && rollup -c rollup.config.min.js"
  },
"devDependencies": {
    "babel-core": "6.26.0",
    "babel-plugin-transform-object-rest-spread": "6.26.0",
    "babel-preset-env": "^1.6.1",
    "eslint": "^4.18.1",
    "eslint-config-standard": "^11.0.0",
    "eslint-plugin-promise": "^3.6.0",
    "eslint-plugin-standard": "^3.0.1",
    "rollup": "^0.56.2",
    "rollup-plugin-babel": "^3.0.3",
    "rollup-plugin-commonjs": "^8.3.0",
    "rollup-plugin-node-resolve": "^3.0.3",
    "rollup-plugin-uglify": "^3.0.0"
  },
  "dependencies": {
    "custom-event": "^1.0.1"
  },
  "browserslist": [
    "last 2 versions",
    "> 3%",
    "ie 10-11"
  ]

So basically, testing environement is missing, which Ive never done before. I might try it tmrw. Or at least provide some simple working example (tested it in my project and it is working). However, the package is much more minimalistic now and does the job. Anyway I would be happy if anyone can try it out. Copy the ./dist/lory.module.js (for es module) or ./dist/lory.min.js (umd) to your projects and let me know!

1reaction
nstanardcommented, Jun 28, 2017

Will be taking a closer look at using lory with rollup as soon as I am able.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Latest babel preset doesn't work with rollup #120 - GitHub
In looking at the referenced babel docs, it seems to suggest using a module transformer, but I assume rollup/rollup-plugin-babel should be ...
Read more >
Rollup error: could not load a module from @babel/runtime ...
I'm trying to compile this index.js file using rollup: import React from "react"; import ReactDOM from "react-dom"; import Grid from ...
Read more >
@rollup/plugin-typescript - npm
If a type error is detected, the Rollup build is aborted when this option is set to true. files , include , exclude....
Read more >
rollup-plugin-babel | Yarn - Package Manager
This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel. Seamless integration between Rollup and Babel.
Read more >
Automating a React Library's Build Process with RollupJS and ...
Required for @rollup/plugin-babel , which will be discussed later on in this tutorial. @babel/preset-env - A preset that provides a sensible ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found