Closed oxsmose closed 2 months ago
The error you're encountering is related to Vite and Rollup failing to resolve the @shopify/polaris module during the build process. Here are a few steps you can take to troubleshoot and resolve this issue:
1- Check Dependency Installation: Ensure that @shopify/polaris is correctly listed in your package.json dependencies and is installed. You can do this by running:
in path web/frontend
npm install @shopify/polaris
2- Import Path: Verify that the import path in i18nUtils.js is correct. It should look something like this:
import {
DEFAULT_LOCALE as DEFAULT_POLARIS_LOCALE,
SUPPORTED_LOCALES as SUPPORTED_POLARIS_LOCALES,
} from "@shopify/polaris";
3- Externalize the Module: If you want to externalize the module as suggested by the error message, you can modify your Vite configuration. Add @shopify/polaris to the build.rollupOptions.external in your vite.config.js
:
in your web/frontend/vite.config.js
// vite.config.js
export default {
// ...
build: {
rollupOptions: {
external: ['@shopify/polaris']
}
}
// ...
};
By following these steps, you should be able to resolve the issue with the Vite build process in your Docker environment.
Hi there 👋
I was not able to reproduce this on my side. Could you provide a minimal repository for reproduction if you would like me to investigate further?
Thanks for your feedback. It helped me to solve the issue by adding the missing modules (some others are impacted) in package.json under web/ folder. then npm run do the job. My container is now working as expected.
When I tried to build the application using docker file I've got this error:
@shopify/shopify-app-express
version:My docker file: