-
Notifications
You must be signed in to change notification settings - Fork 208
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
Error after updated to v7.3.0 #221
Comments
Hi, sorry you are running into this issue!
It's a little hard for me to understand what might be going wrong from just
looking at your screenshot. Is there any chance you could put up a repo
that minimally reproduces the issue?
…On Wed, Oct 4, 2017, 4:13 AM Henric Trotzig ***@***.***> wrote:
The mjs extension was added (and discussed) in #220
<#220>. I don't have much
context on that change, so I'm going to ask @lencioni
<https://github.com/lencioni> for help here. Thanks for taking the time
to report this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#221 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAL7zrcI_-LMeom6oH-0nlUsJWRWhiMJks5so2hFgaJpZM4PtEOJ>
.
|
Hi @lencioni , I have quickly setup a react app using create-react-app: https://github.com/colloquet/waypoint-test I have only added react-waypoint v7.3.0 and a Waypoint component to App.js and still getting the same error. Colloque |
I have exactly the same problem after upgrading to 7.3.0 |
Unfortunately I've run into the same problem. After updating it to 7.3 it started giving me a similar error: invariant.js:42 Uncaught Error: Invalid tag: /static/media/index.73a4b08a.mjs |
Thanks for the repo, it was very helpful. I'm not super familiar with create-react-app, but it seems to me that its webpack has been configured to recognize files with names that end in I opened an issue on create-react-app here: facebook/create-react-app#3237 In the short term, you can either stick with 7.2.0 for now, or import waypoint like Sorry for the trouble, I hope we can get this resolved soon! |
same issue here, glad you reported it upstream to CRA, will track both that and this and stick with 7.2.0 for now :) |
After releasing 7.3.0, we've seen folks run into issues (#221) with the new `module` field added to package.json. I've tried to read up on how webpack uses this field, and it looks like it will pick it up by default. This is tricky because most people will expect a CommonJS export (i.e. `module.exports = ...`), but now they suddenly have to import react-waypoints using const Waypoint = require('react-waypoint').default; There's a lengthy issue over at webpack discussing this [1], with a few proposed solutions at the bottom: - offer a separate package like lodash does (lodash-es), or - skip the module field and use a es-specific entry point, like import a from 'yourpkg/es' - skip the module field, avoid es modules (my preferred solution for most of my modules) I'm opting for the second point here. We can use the commonjs bundle as the default, and then if people are adventurous they can point at the es module directly: import Waypoint from 'react-waypoint/build/index.mjs'; We're not really going to the bottom of this issue with this commit. But I believe it will solve headaches for a lot of applications. For instance, I just found out that one developer in my team spent time chasing down a bug where parts of the application wouldn't work. Waypoints that were imported with `import Waypoint from 'react-waypoint'` were working, but not the ones being imported via `const Waypoint = require('react-waypoint')` (we have some legacy). Fixes #221 [1] webpack/webpack#4742
A fix for this was released in 7.3.1. Thanks for the quick reports everyone! |
Thanks! Appreciate your help! |
What is the motivation for going with |
This is exactly right, and is the primary reason for the decision. Although it's still early on, there's a good chance that
I brought up these concerns when we merged in the PR that added this extension. The team decided in that PR that it's worth trying it out. My favorite part of the folks who work on Waypoint is that they're really reasonable. If the extension ends up causing too many issues for users, then I'm sure the team would consider switching back to |
I tried updating all of the places I could think of with the new extension and kept getting errors, so I gave up and stuck with cjs for now. I'll keep watching the repo to see what happens here and try again later |
Ah, alright. I'm sorry you're running into those issues, @benbrandt . If you post more details about what sorts of errors you were seeing with the |
Hi,
I have updated react-waypoint to 7.3.0 today and I am getting this error:
Everything is working fine after I revert back to v7.2.0
Is this a bug or am I missing something?
Thanks!
The text was updated successfully, but these errors were encountered: