-
Notifications
You must be signed in to change notification settings - Fork 69
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
fix: use .css extension on react-loading-skeleton import #2362
Conversation
react-loading-skeleton defines an exports field in its package.json which looks like this: "exports": { ".": { "types": "./dist/index.d.ts", "require": "./dist/index.cjs", "import": "./dist/index.js" }, "./dist/skeleton.css": "./dist/skeleton.css" }, The webpack documentation states that if an exports field is defined in package.json, it replaces the default module loading behavior and any other request for a module will result in a ModuleNotFound error. Our call to load react-loading-skeleton in Paragon looks like this: @import "~react-loading-skeleton/dist/skeleton"; That isn’t in the list of possible exports. This is though: @import "~react-loading-skeleton/dist/skeleton.css"; This commit updates our import to the latter, which fixes downstream issues in MFEs that can’t figure out how to import react-loading-skeleton
✅ Deploy Preview for paragon-openedx ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
I'm going to get this in so we can see if it officially fixes the issue in downstream MFEs once they upgrade to this version of Paragon. I was able to test it locally, but it'd be nice to have that validation. It may be that there's an upcoming fix in some webpack-related library that will make this unnecessary in the long run, but I wasn't able to find something. For now, it seems benign and solves problems. |
OMG the list of checks was so long I didn't see that tests were still running when I merged. Ugh. Process fail. |
🎉 This PR is included in version 20.43.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@davidjoy I would want to ask which Paragon version and which MFE is that where this issue is? |
Oof, that would have been good information to include. So the issue is that Paragon didn't pin down a dependency on react-loading-skeleton, so it could affect any paragon version that had react-loading-skeleton at react-loading-skeleton was introduced to Paragon in this PR: #1379, which was included in v20.4.0 of Paragon. So any MFE using that version through v20.43.2 of Paragon can break with this issue. At the time, we saw it manifesting in frontend-app-course-authoring on the |
react-loading-skeleton defines an exports field in its package.json which looks like this: "exports": { ".": { "types": "./dist/index.d.ts", "require": "./dist/index.cjs", "import": "./dist/index.js" }, "./dist/skeleton.css": "./dist/skeleton.css" }, The webpack documentation states that if an exports field is defined in package.json, it replaces the default module loading behavior and any other request for a module will result in a ModuleNotFound error. Our call to load react-loading-skeleton in Paragon looks like this: @import "~react-loading-skeleton/dist/skeleton"; That isn’t in the list of possible exports. This is though: @import "~react-loading-skeleton/dist/skeleton.css"; This commit updates our import to the latter, which fixes downstream issues in MFEs that can’t figure out how to import react-loading-skeleton
Folks are seeing errors like this in MFEs:
react-loading-skeleton defines an exports field in its package.json which looks like this:
The webpack documentation states that if an exports field is defined in package.json, it replaces the default module loading behavior and any other request for a module will result in a ModuleNotFound error.
Our call to load react-loading-skeleton in Paragon looks like this:
That isn’t in the list of possible exports. This is though:
This commit updates our import to the latter, which fixes downstream issues in MFEs that can’t figure out how to import react-loading-skeleton
Deploy Preview
Include a direct link to your changes in this PR's deploy preview here (e.g., a specific component page).
Merge Checklist
example
app?wittjeff
andadamstankiewicz
as reviewers on this PR.Post-merge Checklist