Closed Inateno closed 6 years ago
I'm really not sure, as I've never experience this issue before. Maybe someone from rollup / babel will be able to help.
Helpers.
Rollup config:
import babel from 'rollup-plugin-babel'
import commonjs from 'rollup-plugin-commonjs'
import external from 'rollup-plugin-peer-deps-external'
import postcss from 'rollup-plugin-postcss'
import resolve from 'rollup-plugin-node-resolve'
import url from 'rollup-plugin-url'
import pkg from './package.json'
export default {
input: 'src/index.js',
output: [
{
file: pkg.main,
format: 'cjs'
},
{
file: pkg.module,
format: 'es'
}
],
plugins: [
external(),
postcss({
modules: true
}),
url(),
babel({
exclude: 'node_modules/**'
}),
resolve(),
commonjs()
]
}
And Babelrc config:
{
"presets": [
["env", {
"modules": false
}],
"stage-0",
"react"
],
"plugins": [
"external-helpers"
]
}
Thanks for following up @Inateno.
I'm not seeing any differences with your rollup config or babelrc from the defaults that create-react-library
uses. Would you mind pointing out what changed so I can update the template accordingly? Thanks!
Hi, nothing changed.
I just wrote the config here as helpers for those helping me on external website ^^. So, I just resolved my issue. There is nothing to do with rollup or config it's just a stupid npm issue.
Details:
My package is in /package/panel It uses an npm dependency stored in root as "vr-ui"
The root package.json doesn't have all dependencies listed (I'm using Lerna) So by adding
"babel-plugin-external-helpers": "^6.22.0"
In my root package.json, everything is going fine.
Hope this will help anyone in the future because the error has nothing to do with what it described.
@Inateno champion for coming back here to say that, cheeeeeers
Hi,
I'm using the default configuration and one of my modules trigger this error and I can't figure it out.
This module is causing the issue:
And here is the core of the module:
This error occurs sometimes but the link given in the error doesn't give enough details since I'm using your default configuration I'm just lost, seems like it doesn't like the package for any reason (I can't find which one).
I got this issue few times with others modules and it was mainly because the export wasn't set to "default" or some strange things my mates did (ES8 requiring an extra module). But here, this one is so simple I have no ideas.
If I copy the whole content of my file "dispatchStdEvent" inside my package, it builds.
The problem comes only from import/export then?
Thanks