Closed herdsothom closed 1 year ago
It looks like Jest wasn't expecting the export
token from the uuid
package (a dependency of DynamoDB). According to issue 488 from the UUID repository, this seems to be related to a "reverse dependency of this package".
Some users have reported this issue solving itself after updating their version of NodeJS.
I'd reckon you create a separate issue in https://github.com/thenativeweb/uuidv4/ as suggested by @ctavan here. This likely isn't an issue with NextJS.
It looks like Jest wasn't expecting the
export
token from theuuid
package (a dependency of DynamoDB). According to issue 488 from the UUID repository, this seems to be related to a "reverse dependency of this package".Some users have reported this issue solving itself after updating their version of NodeJS.
I'd reckon you create a separate issue in https://github.com/thenativeweb/uuidv4/ as suggested by @ctavan here. This likely isn't an issue with NextJS.
Thanks for the reply Ryan.
Unfortunately Im already on node16 so dont think I can find a fix there.
Howcome you suggest to raise the issue in uuidv4 rather than just uuid? Isnt uuid
the package dynamo is using here?
It looks like Jest wasn't expecting the
export
token from theuuid
package (a dependency of DynamoDB). According to issue 488 from the UUID repository, this seems to be related to a "reverse dependency of this package". Some users have reported this issue solving itself after updating their version of NodeJS. I'd reckon you create a separate issue in https://github.com/thenativeweb/uuidv4/ as suggested by @ctavan here. This likely isn't an issue with NextJS.Thanks for the reply Ryan. Unfortunately Im already on node16 so dont think I can find a fix there. Howcome you suggest to raise the issue in uuidv4 rather than just uuid? Isnt
uuid
the package dynamo is using here?
Yes, uuid
would be the correct package.
Sorry about that.
Raising an issue in the uuidjs/uuid project now. Ps heres a codesandbox: https://codesandbox.io/s/boring-resonance-g84z3y?file=/__tests__/example.test.js
Please verify that your issue can be recreated with next@canary
.
please verify canary
label?We noticed the provided reproduction was using an older version of Next.js, instead of canary
.
The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. You can think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running npm install next@canary
and test it in your project, using your reproduction steps.
If the issue does not reproduce with the canary
version, then it has already been fixed and this issue can be closed.
canary
?The safest way is to install next@canary
in your project and test it, but you can also search through closed Next.js issues for duplicates or check the Next.js releases. You can also use the GitHub template (preferred), or the CodeSandbox or StackBlitz templates to create a reproduction with canary
from scratch.
canary
now?Next.js does not backport bug fixes to older versions of Next.js. Instead, we are trying to introduce only a minimal amount of breaking changes between major releases.
An issue with the please verify canary
that receives no meaningful activity (e.g. new comments that acknowledge verification against canary
) will be automatically closed and locked after 30 days.
If your issue has not been resolved in that time and it has been closed/locked, please open a new issue, with the required reproduction, using next@canary
.
Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps. Furthermore, you can upvote the issue using the :+1: reaction on the topmost comment (please do not comment "I have the same issue" without repro steps). Then, we can sort issues by votes to prioritize.
We look into every Next.js issue and constantly monitor open issues for new comments.
However, sometimes we might miss one or two due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.
Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.
It seems that there has been fix in the uuid
package.
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
I cannot get Jest to work correctly with my new install of NextJS, when using a test that calls a file that imports DynamoDB (im assuming this will also happen for other packages)
I get the following error:
This happens when the test calls an exported function that imports DynamoDB.
Of course if i simply remove the import, the test will pass.
Expected Behavior
The test should pass
Link to reproduction
See the reproduce steps
To Reproduce
To reproduce it using a very basic setup, i ran:
npx create-next-app --example with-jest with-jest-app
I added to my
package.json
dependencies:"@aws-sdk/client-dynamodb": "^3.121.0",
I created a new test file
example.test.js
in the__tests__
directory. Note that in this new test file, a simple test likeexpect(1).toBe(1)
works fine. If I make it:And in
ddb.js
: