petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.25k stars 301 forks source link

[BUG] Compiled with problems #818

Closed marcpropeller closed 1 year ago

marcpropeller commented 1 year ago

Describe the bug Compiled with problems:

ERROR in ./node_modules/react-virtuoso/dist/index.m.js

Module build failed (from ./node_modules/source-map-loader/dist/cjs.js): Error: ENOENT: no such file or directory, open '/code/node_modules/react-virtuoso/dist/index.m.js'

Reproduction Just install 4.0.1 or 4.0.2. npm install react-virtuoso@4.0.1 or npm install react-virtuoso@4.0.2

To Reproduce Try to compile with 4.0.1 or 4.0.2

Expected behavior Not to crash

Screenshot compile

Desktop (please complete the following information):

Additional context If I downgrade to 4.0.0 everything works as expected. Looking at the node_modules/react-virtuoso/dist folder I can't find index.m.js, but I can find index.mjs. In version 4.0.0, I can find index.m.js. So this looks like it's probably just a typo.

Please let me know if there is any other information you require,

Thanks

Marc

petyosi commented 1 year ago

That's weird, is there any cache involved? Can I reproduce this somehow? I shipped index.m.js in 4.0.0 but had to change it due to how type=module works.

For the record, the line points to the right file.

marcpropeller commented 1 year ago

Hi @petyosi, The way I reproduced it was to delete the node_modules/react-virtuoso folder, then ran either: npm install react-virtuoso@4.0.1 or npm install react-virtuoso@4.0.2

I ran no other commands.

As this was the only package I changed, could it be a conflict with another package or something else that needs upgrading too?

The dependencies and dev-dependencies in my package.json:

{
    "dependencies": {
        "@capacitor/android": "^4.4.0",
        "@capacitor/app": "^4.1.0",
        "@capacitor/core": "^4.4.0",
        "@capacitor/device": "^4.0.1",
        "@capacitor/haptics": "^4.0.1",
        "@capacitor/ios": "^4.4.0",
        "@capacitor/keyboard": "^4.0.1",
        "@capacitor/status-bar": "^4.0.1",
        "@fortawesome/fontawesome-svg-core": "^6.2.0",
        "@fortawesome/free-regular-svg-icons": "^6.2.0",
        "@fortawesome/free-solid-svg-icons": "^6.2.0",
        "@fortawesome/react-fontawesome": "^0.2.0",
        "@ionic/react": "^6.0.0",
        "@ionic/react-router": "^6.0.0",
        "@ionic/storage": "^3.0.6",
        "@material/elevation": "^14.0.0",
        "@mobiscroll/react": "^5.19.2",
        "@mui/material": "^5.10.13",
        "@react-google-maps/api": "^2.16.0",
        "@reduxjs/toolkit": "^1.9.0",
        "@testing-library/jest-dom": "^5.16.5",
        "@testing-library/react": "^13.4.0",
        "@testing-library/user-event": "^14.4.3",
        "@types/jest": "^29.2.2",
        "@types/node": "^18.11.9",
        "@types/react": "^18.0.17",
        "@types/react-dom": "^18.0.6",
        "@types/react-router": "^5.1.11",
        "@types/react-router-dom": "^5.1.7",
        "ag-grid-community": "^28.2.1",
        "ag-grid-react": "^28.2.1",
        "axios": "^1.1.3",
        "bootstrap": "^5.2.2",
        "chart.js": "^3.9.1",
        "docker": "^1.0.0",
        "emoji-picker-react": "^4.4.5",
        "get-browser-fingerprint": "^2.1.1",
        "ionicons": "^6.0.3",
        "moment": "^2.29.4",
        "react": "^18.2.0",
        "react-bootstrap": "^2.6.0",
        "react-chartjs-2": "^4.3.1",
        "react-color": "^2.19.3",
        "react-dom": "^18.2.0",
        "react-drag-hierarchy-tree": "^0.3.2",
        "react-geocode": "^0.2.3",
        "react-image-gallery": "^1.2.11",
        "react-pdf": "^5.7.2",
        "react-redux": "^8.0.5",
        "react-router": "^5.2.0",
        "react-router-dom": "^5.2.0",
        "react-select": "^5.6.0",
        "react-simple-image-viewer": "^1.2.2",
        "react-to-print": "^2.14.8",
        "react-toastify": "^9.1.1",
        "react-virtuoso": "^4.0.1",
        "sanitize-html": "^2.7.3",
        "sass": "^1.56.0",
        "styled-components": "^5.3.6",
        "typescript": "^4.8.4",
        "validator": "^13.7.0",
        "web-vitals": "^3.0.4",
        "workbox-background-sync": "^6.5.4",
        "workbox-broadcast-update": "^6.5.4",
        "workbox-cacheable-response": "^6.5.4",
        "workbox-core": "^6.5.4",
        "workbox-expiration": "^6.5.4",
        "workbox-google-analytics": "^6.5.4",
        "workbox-navigation-preload": "^6.5.4",
        "workbox-precaching": "^6.5.4",
        "workbox-range-requests": "^6.5.4",
        "workbox-routing": "^6.5.4",
        "workbox-strategies": "^6.5.4",
        "workbox-streams": "^6.5.4"
    },
    "devDependencies": {
        "@capacitor/cli": "^4.4.0",
        "@types/react-color": "^3.0.6",
        "@types/react-image-gallery": "^1.2.0",
        "@types/react-pdf": "^5.7.4",
        "@types/sanitize-html": "^2.6.2",
        "@types/styled-components": "^5.1.26",
        "@types/validator": "^13.7.10",
        "react-scripts": "5.0.1"
    },
}
petyosi commented 1 year ago

I'm afraid that I can't help you further. index.m.js has been referenced in v4.0.0 but not in v4.0.1 (see package contents) - so something outside of the package itself (somewhere in your setup) has a stale reference to that file.