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 fetch unrar.wasm #37

Closed
honeo opened this issue Jun 6, 2022 · 4 comments
Closed

Failed to fetch unrar.wasm #37

honeo opened this issue Jun 6, 2022 · 4 comments

Comments

@honeo
Copy link

honeo commented Jun 6, 2022

Confirmed on Windows 10, Ubuntu 22.04.
Since Node.js v18.1.0 I get the following error.

TypeError: Failed to parse URL from ...node-unrar-js/dist/js/unrar.wasm
@YuJianrong
Copy link
Owner

Confirmed on Windows 10, Ubuntu 22.04. Since Node.js v18.1.0 I get the following error.

TypeError: Failed to parse URL from ...node-unrar-js/dist/js/unrar.wasm

@honeo I cannot reproduce in on node v18.3.0, can you create a sample project and shared on github?

@honeo
Copy link
Author

honeo commented Jun 13, 2022

I have created a repository to reproduce the problem, please check it.
honeo/example-node-unrar-js

Also, the fact that the unrar.js code is displayed in the console when an error occurs was inconvenient because other logs were flowing during the verification.
Can this feature be made optional?

@YuJianrong
Copy link
Owner

@honeo I've pushed a new version v2.0.0 to enable the support of node v18, please install the v2.0.0 and try again.
BTW, this code didn't work actually:

for(let {fileHeader, extraction} of files){
	fileHeader.flags.directory ?
		await fsp.mkdir(fileHeader.name):
		await fsp.writeFile(fileHeader.name, extraction);
}

Because in RAR archive, the files are placed at begging and folders are on the end. You may change it to console.log(JSON.stringify(fileHeader), extraction); to see how it works.

@honeo
Copy link
Author

honeo commented Jun 17, 2022

Thanks for the fix, now we can update Node.js!
I'm also very happy that the fileHeader now includes the Directory, as it did in ver0, so I don't have to use getFileList in advance.

That code is just a SAMPLE and as I mentioned in the comments, it doesn't work.
Never mind.😉

@honeo honeo closed this as completed Jun 17, 2022
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