-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker build source files issue. API routes does not work. #9157
Comments
Also, after converting the config to the ES module, it doesn't seem to work in production (e.g. Error in loading config: This is caused by either a bug in Node.js or incorrect usage of Node.js internals. before: const { loadEnv, defineConfig, Modules } = require("@medusajs/utils");
loadEnv(process.env.NODE_ENV, process.cwd());
const config = defineConfig({
projectConfig: {
// ...
},
// ...
});
module.exports = config; after: import { loadEnv, defineConfig, Modules } from "@medusajs/utils";
loadEnv(process.env.NODE_ENV, process.cwd());
const config = defineConfig({
projectConfig: {
// ...
},
// ...
});
export default config; |
Hey, it seems you are not copying the
|
@thetutlage yeah, for some reason it wasn't generated with the |
It seems to work using similar setup for scripts from Medusa 1.0. "scripts": {
"clean": "cross-env ./node_modules/.bin/rimraf dist",
"build": "cross-env npm run clean && medusa build && tsc -p tsconfig.json",
} But without copying the Cannot GET /store/custom Maybe we should do like this? COPY --from=builder /usr/src/app/dist ./src |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 3 days. |
This issue was closed because it has been stalled for 3 days with no activity. |
Bug report
Describe the bug
I'm deploying fly.io using a docker build, compared to version 1.0 there are a few issues with the same production image. The API routes don't work unless the
/src
folder is commited on the production server (these are typescript files, not sure why that seems necessary).After running
medusa build
only the/build
folder is created,/dist
is missing for some reason. Running locally the build script outputs the/dist
folder, so not sure about that behavior.Also, in the latest medusa release,
x-publishable-api-key
seems to have no effect if we commit the/src
folder to access API routes.System information
Medusa version (including plugins): v2.0.9-preview
Node.js version: 22
Database: Postgres (sslmode disable)
Operating system: Linux
Browser (if relevant): Chrome
Screenshots
Code snippets
Dockerfile
:fixed
Dockerfile
last stage:The text was updated successfully, but these errors were encountered: