Cova9mo ago

Deno Deploy JSON import

I'm using zod-i18n-map library for error translation, which requires an import for the library itself and an import for the translation file, like this: "imports": { "@zod-18n-map": "npm:zod-i18n-map", "@zod-18n-map/es": "npm:zod-i18n-map/locales/es/zod.json", ... } It is working locally by asserting the import as json: import translation from "@zod-18n-map/es" assert { type: "json", }; But in deno-deploy it's not working and it's showing this error: {"type":"error","code":"deploymentFailed","ctx":"The deployment failed: BOOT_FAILURE\n\nExpected a \"JSON\" module but loaded a \"JavaScript\" module."} I did manage to solve by copying over the json file as an object in my project, but wanted to ask if there's some other way to get this to work while keeping the import of json file.
2 Replies