Skip to content
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

Failed to parse source map #4

Open
flckv opened this issue Oct 12, 2023 · 5 comments
Open

Failed to parse source map #4

flckv opened this issue Oct 12, 2023 · 5 comments

Comments

@flckv
Copy link

flckv commented Oct 12, 2023

Failed to parse source map from '/node_modules/@mediapipe/tasks-vision/vision_bundle_mjs.js.map' file: Error: ENOENT: no such file or directory, open '/node_modules/@mediapipe/tasks-vision/vision_bundle_mjs.js.map'

Failed to parse source map from '/node_modules/@react-three/drei/node_modules/@mediapipe/tasks-vision/vision_bundle_mjs.js.map' file: Error: ENOENT: no such file or directory, open '/node_modules/@react-three/drei/node_modules/@mediapipe/tasks-vision/vision_bundle_mjs.js.map'

I checked the file is there.

@srcnalt
Copy link
Owner

srcnalt commented Oct 12, 2023

Hi @flckv,

Are you having the issue on this sample, or a modified version? Make sure to have the version of libraries the same.

@flckv
Copy link
Author

flckv commented Oct 13, 2023

hi @srcnalt , thanks for getting back to me. It shows the camera and avatar but the avatar is not mimicking my facial expressions I am assuming because of this error. I tried

with just cloning this repo and

npm install --save typescript @types/node @types/react @types/react-dom @types/jest 
npm install @mediapipe/tasks-vision
npm install @react-three/fiber
npm install @react-three/drei
npm install react-dropzone

from scratch following the video:

npx create-react-app my-app --template typescript
npm install @mediapipe/tasks-vision
npm i @react-three/fiber @react-three/drei three

I attempted to solve it without success with these approaches :
npm install source-map-loader
GENERATE_SOURCEMAP=false in .env

  "scripts": {
    "start": "node suppress-source-map-warnings.js && react-scripts start",
..

suppress-source-map-warnings.js:

const { readFileSync, writeFileSync } = require("fs");

const path = "node_modules/source-map-loader/dist/utils.js";
const regex = /.*throw new Error\(`Failed to parse source map from '\${sourceURL}' file: \${error}`\);*/;

const text = readFileSync(path, "utf-8");
const newText = text.replace(regex, `buffer="";sourceURL="";`);
writeFileSync(path, newText, "utf-8");

npm run start

@srcnalt
Copy link
Owner

srcnalt commented Oct 13, 2023

Since the video, I did not update any libraries, could you try downloading the project and just running npm i to install the current versions in package.json, I do remember running into this issue while working on the project however I cannot remember how I fixed those.

@flckv
Copy link
Author

flckv commented Oct 14, 2023

I did now, but no luck

@srcnalt
Copy link
Owner

srcnalt commented Oct 16, 2023

Can you create a reproducable codesandbox where I can try it? Testing locally it works for me from main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants