Open EdmundasD opened 8 months ago
@EdmundasD, was the solution to unblock you and resolve this to upgrade your version of Node.js?
Looks like you're correct that we need to update our Set Up Amplify Prerequisites sections to display the proper version of node (as seen in the v5 to v6 migration guides).
Thanks for looking into this @cwomack. I have yet to try seeing if this works with an upgraded Node.js version as that currently might not be a viable solution in my specific case. But, I can certainly try it on my local machine.
@EdmundasD, let me know upgrading to a more recent version of Node.js resolves the issue for you. Can you confirm if setting skipLibCheck
to true
in your ts.config
under compilerOptions
is another way to work around the errors? Thanks.
So I played around with this and this is what I found:
"skipLibCheck": true
to the tsconfig.json
did not help.--experimental-fetch
flag is needed if running with Node.js version between 16.15.0 and 17.9.1.Hi @EdmundasD can you confirm what version of aws-amplify
you are using so that we can reproduce the issue? It seems a while back we specifically addressed a similar issue in a PR
Sure @chrisbonifacio. I'm using v6.0.18
.
Hi @EdmundasD, apologies for the delay. I had some issues downgrading to Node 14 due to the version of python installed on my machine. Tried downgrading with nvm but apparently I'd need to downgrade my version of python3 as well...
If you get a chance, can you try reproducing the issue on a fresh project and let us know if the issue persists?
EDIT: downgrading to 16.0.0 should also reproduce this issue but my local test projects are on Next which require Node 18.17.0+. Can you please share your package.json file so that we use the same framework and versions as your project?
Or, if you can provide a small sample app that would reproduce the issue please do 🙏
@chrisbonifacio, tried with latest aws-amplify
version of 6.3.1
but still encountering the same error.
Went through Amplify's docs and created a small example: https://github.com/EdmundasD/amplifyv6/tree/main
Let me know if you have any questions.
Thank you for the repo @EdmundasD. I was able to reproduce the issue consistently. We will be updating the docs to reflect the correct node version support.
Before opening, please confirm:
JavaScript Framework
Not applicable
Amplify APIs
REST API, GraphQL API
Amplify Version
v6
Amplify Categories
api
Backend
Amplify CLI
Environment information
Describe the bug
According to Amplify's Set up Amplify prerequisites, the Node.js requirement is
v14.x or later
. However, in the codebase, there is a reference to the globalFormData
class, which was added to Node.js inv16.15.0
, according to the [Node.js docs](https://nodejs.org/docs/latest-v16.x/api/globals.html#class-formdata:~:text=the%20fetch()%20function.-,Class%20FormData,-%23).Expected behavior
I believe one of two things should be done...
a) The Amplify's prerequisite docs should be updated to require Node.js v16.15.0 or later
b) Include
form-data
as a dependency from which to referenceFormData
Reproduction steps
Occurred while migrating from v5 to v6.
Full disclosure: Have not attempted to create a new project with v6 from scratch to try and reproduce the issue.
Code Snippet
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response