Skip to content

TypeError: Object(...) is not a function #2

Closed
@tatchi

Description

@tatchi

TypeError: Object(...) is not a function

With the new version 0.11 which fix issue #1, I have now an error when trying to import the getBundles function.

import { getBundles } from 'react-loadable-ssr-addon'

Expected Behavior

No Errors

Current Behavior

I got the following error:

TypeError: Object(...) is not a function

Possible Solution

I was able to make it work if in the index.js file, we export the two modules like that:

module.exports = { ReactLoadableSSRAddon, getBundles };

and we import them like:

const { ReactLoadableSSRAddon } = require('react-loadable-ssr-addon');
import { getBundles } from 'react-loadable-ssr-addon'

I was not able to find a way to keep the default export. I don't have any experience with bundling lib, but I suppose it's a problem with the different modules systems.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions