-
Notifications
You must be signed in to change notification settings - Fork 96
react\react.js does not export default #10
Comments
That's odd. It works for me in this simple example: https://gist.github.com/Rich-Harris/cd0c293f5263b2450412. (Clone it, Strictly speaking, your code should probably say import * as React from 'react'; rather than import React from 'react'; since React itself is just a namespace. |
thx, this should work. |
Getting the same error here. And using
|
I'm wondering if this related:
That particular module uses this way of exporting stuff. Works with Browserify, though. |
Looks like using |
@atombender @Rich-Harris I'm confused about this error, I get it when using the If I build my code allowing all
because it is trying to call a //this ternary check is true
var require$$9$1 = (createClass && typeof createClass === 'object' && 'default' in createClass ? createClass['default'] : createClass); When I exclude the
I have no idea why this is happening, and am curious if it is a bug or I am just not including/excluding properly? |
Having the same kind of issue: In my rollup config I have the following: {
globals: { "underscore": "require('underscore')"},
external: ['underscore']
} My iife bundle function is called like: (function (_) {
'use strict';
var ___default = _['default'];
///all the code
}(require('underscore'))); But inside the code
|
Just added
Any tips on how to do this? |
hey @Hikariii not sure about underscore, but to get lodash working I used common-js plugin. I'm guessing that you need common-js plugin to tell node-resolve that your nodeResolve({
extensions: ['.js'],
main: true,
browser: true,
preferBuiltins: false
}),
commonjs({
namedExports: {
lodash: [
'assign',
'keys',
'max',
'set',
'values'
]
},
include: [
'node_modules/**/*.js'
],
exclude: [
es6Glob
]
}), |
Any updates on this? Got the same issue with React.
|
We were using 0.56.5. Upgraded to 0.62.0 fixed the issue. |
I have React installed in
node_modules
and import it in./src/main.js
, with such configs:But it ran into some issue:
Without
rollup-plugin-npm
it works but sure it does not include React in the Rollup bundle.The text was updated successfully, but these errors were encountered: