Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

named export is undefined #53

Open
sam-rad opened this issue May 10, 2017 · 4 comments
Open

named export is undefined #53

sam-rad opened this issue May 10, 2017 · 4 comments

Comments

@sam-rad
Copy link

sam-rad commented May 10, 2017

When using loader's syntax I get undefined for named exports:

// Comey.js
const Dismissed = () => <div> :| </div>
const Career = () => <div> ;| </div>

export {
  Dismissed as default,
  Career
};


// main.js
import Dismissed, { Career } from 'bundle-loader?lazy!./Comey';

console.log(Dismissed); //  function (cb) { blah }
console.log(Career);  // `undefined`


// - "webpack":       "2.4.1",
// - "bundle-loader": "0.5.5",
@michael-ciniawsky
Copy link
Member

@snikobonyadrad Also when using require() ?

@sam-rad
Copy link
Author

sam-rad commented May 10, 2017

Yes sir:

var Dismissed = require('bundle-loader?lazy!./Comey');

console.log(Dismissed);        // [function]
console.log(Dismissed.Career); // `undefined`

// versus

var Dismissed = require('./Comey');

console.log(Dismissed);        // [function]
console.log(Dismissed.Career); // [function]

@michael-ciniawsky
Copy link
Member

Your webpack.config.js and ideally a small test repo please :)

@sam-rad
Copy link
Author

sam-rad commented May 10, 2017

Here you go webpack-bundle-loader-bug. If you have cloud9 account I can give you access there too. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants