alvarotrigo / react-fullpage

Official React.js wrapper for fullPage.js https://alvarotrigo.com/react-fullpage/
GNU General Public License v3.0
1.28k stars 179 forks source link

Can't find "easings.min.js.map" file #344

Open RexHung0302 opened 2 years ago

RexHung0302 commented 2 years ago

Description

I try to run the code but Terminal give me the warning, how to fix it? It seem an error on plugins, not my code.

Link to isolated reproduction with no external CSS / JS

I don't have the link for demo, but I got the warning screenshoot

image

Steps to reproduce it

  1. yarn
  2. yarn start
  3. "@fullpage/react-fullpage" is warning

Versions

"@fullpage/react-fullpage": "^0.1.26", "react": "^18.2.0",

alvarotrigo commented 2 years ago

That's weird. Make sure the map file (easings.min.js.map) is on your node_modules/fullpage.js/vendors/ folder, like in this pic:

image
alvarotrigo commented 2 years ago

Map files are automatically loaded by the browser dev tools. So it shouldn't even be a compile warning or error.

The source map file will only be downloaded if you have source maps enabled and your dev tools open. You'll also need to upload your original files so the dev tools can reference and display them when necessary.

Source

alvarotrigo commented 2 years ago

I've made made a commit to prevent the loading of the file if you are using css3: true, I'll merge it on the next release. (Although this is not directly related with your issue)

RexHung0302 commented 2 years ago

Sorry for the delay in getting back to you, I has the file on my node_modules/fullpage.js/vendors/ folder, but still got the warning.

截圖 2022-08-03 下午4 50 07

And I got the new waring like this

image

not found /node_modules/@fullpage/react-fullpage/dist/scrolloverflow.min.js.map

alvarotrigo commented 2 years ago

Can you provide an isolated reproduction in Codesandbox with no CSS or JS files external to fullPage.js and the minimum amount of HTML code. Use empty sections unless strictly necessary for the reproduction?

RexHung0302 commented 2 years ago

Okay, here is a demo link in Codesandbox, but it so weird, I use the version 0.1.22 same as my project, but here is no warning. P.S: I remove the licenseKey in demo, but I actually use it in my project, can ignore licenseKey error.

alvarotrigo commented 2 years ago

@RexHung0302 your demo is not working image

RexHung0302 commented 2 years ago

Sorry, I fixed it, I forgot to save it. Codesandbox

alvarotrigo commented 2 years ago

Make sure to update to the latest version of the fullpage-react wrapper version 0.1.26

stuart-garner commented 2 years ago

I am getting the same issue. Started using react-fullpage yesterday and its version 0.1.26.

Same error as above and no files found in the dist folder.

Screenshot 2022-08-07 at 21 18 41
alvarotrigo commented 2 years ago

Mind updating your codesandbox with such version to reproduce the issue?

stuart-garner commented 2 years ago

Updated version to 0.1.27.

Build completes successfully bit error regarding missing file persists

Screenshot 2022-08-07 at 22 54 01
alvarotrigo commented 2 years ago

The codesandbox doesn't show any warning and I can't reproduce it on the examples that come with the component.

alvarotrigo commented 2 years ago

The .map file is inside the vendors folder where the easings.min.js file is. More specifically on node_modules/fullpage.js/vendors/easings.min.js.map.

In any case, this is a warning, not an error, so I wouldn't bother too much. The map file is not really necessary for anything except for debugging in the browser tools for developers.

alvarotrigo commented 2 years ago

I think the problem here is that the easings.min.js file contains the path for the map file on its very bottom:

//# sourceMappingURL=scrolloverflow.min.js.map

This works ok when using vanilla fullPage.js, as people usually don't move files around.

But when creating the fullPage.js bundle, the easings.min.js gets bundled together with the react code on the dist folder (or whatever folder you choose for your bundle) and now the map file isn't there.

I'm not a webpack expert. But the solution is probably:

Probably doable with plugins like the one suggested in this solution: https://stackoverflow.com/questions/33795044/webpack-use-existing-source-map-from-previous-build-step

Or this: https://stackoverflow.com/questions/27639005/how-to-copy-static-files-to-build-directory-with-webpack

Feel free to do a pull request if you find the way :) And if you are aware of any better approach I'm all ears!