Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build this library #14

Closed
aliechti opened this issue Sep 20, 2019 · 3 comments
Closed

How to build this library #14

aliechti opened this issue Sep 20, 2019 · 3 comments

Comments

@aliechti
Copy link

Hi, I'm using webpack with typescript and have some problems.

error  in ./node_modules/@remotelock/react-week-scheduler/index.mjs

Can't import the named export 'useRef' from non EcmaScript module (only default export is available)

I tried to fix it with this (found here graphql/graphql-js#1272):

// webpack.config.js
{
  test: /\.mjs$/,
  include: /node_modules/,
  type: "javascript/auto",
}

Which fixed the build, but then I got another error in the browser:

Uncaught TypeError: Object(...) is not a function
    at TimeGridScheduler (index.mjs:1251)

image

Do you have any hint what I should try to get it to work?

@forabi
Copy link
Contributor

forabi commented Sep 20, 2019

@thejahweh Hey Adrian! Thanks for opening this issue. We use this in production and we have the same webpack rule applied so I'm really surprised this does not work for you. Can you share more details on your setup? Maybe webpack config and package versions?

@aliechti
Copy link
Author

Thanks, the information that you use it this way already and it works helped me allot. So I knew it wasn't the build process.

The problem was the incorrect react version, I've upgraded to 16.8.4 and now it works 👍

@forabi
Copy link
Contributor

forabi commented Sep 22, 2019

Glad it worked!

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

No branches or pull requests

2 participants