-
Notifications
You must be signed in to change notification settings - Fork 58
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
createContext invalid export with .mjs file #7
Comments
Hey @ajhenry, thanks for the interest in this package. Any suggestions on how to fix this? I can look into it this weekend! |
@forabi Thanks for getting back to me. Honestly, I have no idea what is causing this issue, as I am unable to reproduce in codesandbox even though my dependency versions all match Here is what I am met with in my console when I try to import After building and linking locally, changing the Unfortunately, I've never run into this problem with React and don't know where to go from here |
These are good first hints. Thanks! Like I said, will take a stab at fixing
this on weekend.
…On Thu, Jun 20, 2019, 12:24 AM Andrew Henry ***@***.***> wrote:
@forabi <https://github.com/forabi> Thanks for getting back to me.
Honestly, I have no idea what is causing this issue, as I am unable to
reproduce in codesandbox
<https://codesandbox.io/s/competent-nightingale-qc9sf> even though my
dependency versions all match
Here is what I am met with in my console when I try to import
TimeGridScheduler in a JS-only environment bootstrapped with cra.
[image: Screen Shot 2019-06-19 at 5 12 19 PM]
<https://user-images.githubusercontent.com/24923406/59800770-73243780-92b5-11e9-8006-9eed493259be.png>
After building and linking locally, changing the package.json module
extension from .mjs to .js fixes the import error, but then introduces a
hook error that I'm not quite sure what is causing it.
[image: Screen Shot 2019-06-19 at 5 23 01 PM]
<https://user-images.githubusercontent.com/24923406/59802400-ff832a00-92b6-11e9-9833-d74eb4fb292c.png>
Unfortunately, I've never run into this problem with React and don't know
where to go from here
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7?email_source=notifications&email_token=AAHXIGK2DRGFTKGDR3OMRDDP3KP2VA5CNFSM4HZAN6B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYDKOEI#issuecomment-503752465>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAHXIGPLZV3GRQECTMSIP5DP3KP2VANCNFSM4HZAN6BQ>
.
|
@ajhenry Can you test |
Same issue with the non EcmaScript module, I'll try building locally and report back |
That's weird. I went over all the imports in the screenshot above and used namespace imports instead of defaults + named imports. I don't see why this wouldn't work 🤔 |
Not too sure either, but thank you for all your effort! I'm going to close this issue as I have a growing suspicion another package in my dependency tree is causing this. For when I create a new project with the same dependency versions, it does not give me any errors. Thanks again for all your help |
@ajhenry did you ever discover which package was causing the issue for you? I am encountering this same problem and have yet to discover a solution. |
@EthanHolman Unfortunately I did not. I had to switch to another package that didn't have this issue |
@ajhenry @EthanHolman Can you test the suggested change to webpack config in #14 ? |
Hello. I am using React version 16.13.0 and I am having this same issue. The project was created using the create-react-app. Any suggestion? |
I'm having the same error! |
Same error here. |
Hello, I have find a fix to this problem thanks to reactioncommerce/reaction-component-library#399 (comment).
// config-overrides.js
const { override } = require("customize-cra");
const supportMjs = () => (webpackConfig) => {
webpackConfig.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto",
});
return webpackConfig;
};
module.exports = override(
supportMjs()
);
@forabi it might be useful to add this in the README |
@benoit-ctrl Thanks for your hint it solved the mentioned error, but unfortunately, it doesn't display anything in the browser |
@niyodusengaclement Maybe it's rather due to the way you use the scheduler, you could copy and paste some of your code (but nothing sensitive or private) into a codesandbox (https://codesandbox.io/) for testing purposes and if you still have a problem open another ticket with the link to the sandbox. |
Ty @benoit-ctrl, you solution works It was necessary to set manually the height of element |
@devcosta I've tried to set height manually but doesn't help too, here is my sandbox (https://codesandbox.io/s/focused-bush-0eem6) |
|
Thanks, @benoit-ctrl, and others for your support. Now it's working |
We are looking at using this library for our project and it looks really promising, especially with the fluid drag to enlarge.
However, when I try to install the package into a JS-only React project, I am met with the following error:
I copied the code from the sample in the Readme to produce this error
This seems to be an issue related to breaking changes in webpack and how it treats.mjs
files as listed hereAnd a dirty fix appears to be something along the following, as discussed hereEdit
This appears to be an issue with
create-react-app
and the default webpack config it's using, as it will not support.mjs
extensions until jest does.So is there any plan to support projects bootstrapped with
create-react-app
without ejecting?The text was updated successfully, but these errors were encountered: