nodejs-firestore
nodejs-firestore copied to clipboard
Cannot find package '@google-cloud/firestore' imported from /app/server/chunks/2-r5tmKk85.js
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
-
Is this a client library issue or a product issue? This is the client library for . We will only be able to assist with issues that pertain to the behaviors of this library. If the issue you're experiencing is due to the behavior of the product itself, please visit the Support page to reach the most relevant engineers.
-
Did someone already solve this?
- Search the issues already opened: https://github.com/googleapis/nodejs-firestore/issues
- Search the issues on our "catch-all" repository: https://github.com/googleapis/google-cloud-node
- Search or ask on StackOverflow (engineers monitor these tags): http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- Do you have a support contract? Please create an issue in the support console to ensure a timely response.
If the support paths suggested above still do not result in a resolution, please provide the following details.
Environment details
- OS: linux
- Node.js version: 20
- npm version: 9.8.1
-
@google-cloud/firestore
version: 7.1.0
Steps to reproduce
- Create a simple svelte (ts) app and add cloud firestore.
- Build a docker image and run
FROM node:20 AS build
WORKDIR /app
COPY package.json ./
COPY package-lock.json ./
RUN npm install @google-cloud/firestore
RUN npm install
COPY . ./
RUN npm run build
FROM node:20-alpine
COPY --from=build /app/build /app
COPY --from=build /app/package.json /app
ENTRYPOINT [ "node", "/app/index.js" ]
Starting the app and visiting the URL immediately throws 500. with logs
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@google-cloud/firestore' imported from /app/build/server/chunks/2-r5tmKk85.js
at packageResolve (node:internal/modules/esm/resolve:844:9)
at moduleResolve (node:internal/modules/esm/resolve:901:20)
at defaultResolve (node:internal/modules/esm/resolve:1121:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
at ModuleWrap.
Making sure to follow these steps will guarantee the quickest resolution possible.
Thanks!
This sounds like a usage question that might be specific to Svelte or Docker, I'm not seeing anything that indicates an issue with the Firestore SDK yet. Perhaps you will get better support on StackOverflow for this type of usage question.
To help isolate the issue, can you build and run your Svelte app locally without Docker?
I see, yeah seems to be the case that I can. TBH my dev environment is devcontainers so seems to work fine with that. In fact, it works fine without the multi stage build, it's just when using the multi stage build that this fails. I've been pulled into something else, but will do a bit more experiementation and maybe hit up SO as well. Thanks.