Skip to content
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

Problem with loading translations files while working with i18n on my API. #3680

Open
uginy opened this issue Feb 20, 2024 · 1 comment
Open

Comments

@uginy
Copy link

uginy commented Feb 20, 2024

Hello!
Mb someone faced with integration of i18next on backend side while developing api with sst. Translation files couldn't copy to artifacts, as results can't work with i18n on backend.

 [Error: ENOENT: no such file or directory, open '/Users/user/projects/project/my-sst-app/.sst/artifacts/c825b0670a4bb91e87d5f900b7f0b617d0e1374668/packages/functions/src/i18n/locales/en/pdf.json'] {
|  +227ms      errno: -2,
|  +227ms      code: 'ENOENT',
|  +227ms      syscall: 'open',
|  +227ms      path: '/Users/user/projects/project/my-sst-app/.sst/artifacts/c825b0670a4bb91e87d5f900b7f0b617d0e1374668/packages/functions/src/i18n/locales/en/pdf.json'
|  +227ms    },

folder structure:
/ packages / functions / src / i18n / locales/ en / common.json

i18nInit() did in several places, in / stack / MyStack when api loads and tried many places. No way.

I use pnpm for running my project

Will be glad for any kind of advice.

My server env: MAC OS Sonoma, node v18.15.0, pnpm as package manager.
Project written on typescript.

@jayair
Copy link
Contributor

jayair commented Feb 21, 2024

I'm not sure what your exact setup is, but it sounds like you need to copy over these files to your function bundle? https://docs.sst.dev/constructs/Function#copyfiles

If you need more help with this, create a new thread in #help on Discord?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants