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

deep require is no longer supported for uuid library #70

Open
hannaol opened this issue Nov 27, 2020 · 7 comments
Open

deep require is no longer supported for uuid library #70

hannaol opened this issue Nov 27, 2020 · 7 comments

Comments

@hannaol
Copy link

hannaol commented Nov 27, 2020

First of all, thank you for your very helpful library !

I ran into the following problem:
In the file node-pptx/lib/factories/ppt/index.js line 5 a deep requires is used for the uuid library :
const uuidv4 = require('uuid/v4');
According to their page this is deprecated and no longer supported: https://github.com/uuidjs/uuid#deep-requires-no-longer-supported

Therefore the following error is thrown in my project: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './v4' is not defined by "exports" in .../node_modules/uuid/package.json

@heavysixer
Copy link
Owner

@gregdolley Would you mind checking this out?

@gregdolley
Copy link
Contributor

gregdolley commented Jan 15, 2021 via email

@gregdolley
Copy link
Contributor

@heavysixer: this is popping up because we use "require" the uuid library like this in many places:

    const uuidv4 = require('uuid/v4');

...where there is a "uuid/" inside the require param. The warning is telling us, that in uuid lib v7.x (we are on 3.x), we can't import it like this anymore, but rather should use the "import" syntax or something like: "const { v4: uuidv4 } = require('uuid');" for commonJS. But since we're still on v3.x, we shouldn't have to worry about this. I'll try and find why @hannaol was still getting this error.

@gregdolley
Copy link
Contributor

@hannaol - what version of node are you running your code under? Also, could you please post the part of your code that is causing this error?

Thanks!

@Able1991
Copy link

Able1991 commented Mar 1, 2021

An error occurs when using require("node js-pptx");
Maybe the problem is that the version is not explicitly specified in the dependencies?

image

@volyansky
Copy link

The issue is still present and makes the library unusable
Any updates about the fix?

@hannaol
Copy link
Author

hannaol commented Oct 18, 2021

Sorry, i totally forgot about replying to this!

So for me the issue was caused because another library in my project was also using uuid, but version 8. As far as i can remember i installed that dependency before adding nodejs-pptx.
I was able to fix this by including "uuid": "~7" in the dependencies in the package.json of my project and doing a clean install.

(node version 12, and the code that caused this error to arise was the code sample to create a new powerpoint presentation, as far as i can remember)

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

5 participants