```
(node:45356) UnhandledPromiseRejectionWarning: ReferenceError: FileReader is not defined
at /path/to/project/node_modules/@aws-amplify/predictions/lib/Providers/Utils.js:37:22
at new Promise ()
at Object.blobToArrayBuffer (/path/to/project/node_modules/@aws-amplify/predictions/lib/Providers/Utils.js:36:12)
at /path/to/project/node_modules/@aws-amplify/predictions/lib/Providers/AmazonAIIdentifyPredictionsProvider.js:112:25
at new Promise ()
at AmazonAIIdentifyPredictionsProvider.configureSource (/path/to/project/node_modules/@aws-amplify/predictions/lib/Providers/AmazonAIIdentifyPredictionsProvider.js:90:16)
at AmazonAIIdentifyPredictionsProvider. (/path/to/project/node_modules/@aws-amplify/predictions/lib/Providers/AmazonAIIdentifyPredictionsProvider.js:168:51)
at step (/path/to/project/node_modules/@aws-amplify/predictions/lib/Providers/AmazonAIIdentifyPredictionsProvider.js:57:23)
at Object.next (/path/to/project/node_modules/@aws-amplify/predictions/lib/Providers/AmazonAIIdentifyPredictionsProvider.js:38:53)
at fulfilled (/path/to/project/node_modules/@aws-amplify/predictions/lib/Providers/AmazonAIIdentifyPredictionsProvider.js:29:58)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:45356) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 9)
(node:45356) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
```
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
I wasn't sure if this was a bug report of a feature request, so my bad it it needed to be a feature request!
Hey, @ianwijma đź‘‹ I can label this as a feature request for you. The team is continuously working on building support for Next.js so this is definitely something worth considering. Thank you!
Before opening, please confirm:
JavaScript Framework
React, Next.js
Amplify APIs
Predictions
Amplify Categories
predictions
Environment information
Describe the bug
Using
prediction
within the NextJS API routes (which run onNodeJS
) throws the following errorFileReader is not defined
Expected behavior
Although I'm fully aware NextJS API routes are not supported, I think it would be a great addition.
Reproduction steps
Setup a simple NextJS environment with Amplify:
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
I wasn't sure if this was a bug report of a feature request, so my bad it it needed to be a feature request!