-
-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Labels
bugSomething isn't workingSomething isn't workingneeds verificationBug needs to be verified with reproductionBug needs to be verified with reproduction
Description
Hi,
I am using the appleDeviceSpecsForLaunchImages
in my Next.js application to dynamically create splash screen images for the different screen sizes. This works perfectly fine in local dev and prod builds.
Building the application on Vercel works as well, but when I launch the application I get the following 500 error:
Error: ENOENT: no such file or directory, open '/vercel/path0/node_modules/pwa-asset-generator/dist/config/apple-fallback-data.json'
I use this import statement:
import { appleDeviceSpecsForLaunchImages } from 'pwa-asset-generator'
It worked with version 7 of pwa-asset-generator, so I guess it is related to switching to ESM.
I found a workaround though, by directly importing the JSON file with the following import:
import appleDeviceSpecsForLaunchImages from 'pwa-asset-generator/dist/config/apple-fallback-data.json' with { type: 'json' }
The type assertion using with
is crucial here.
System (please complete the following information):
- node version 22.14
- npm version 10.9.2
- pwa-asset-generator version 8.0.4
mononoke-choi
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds verificationBug needs to be verified with reproductionBug needs to be verified with reproduction