Nuxt3 site broken (Cannot find package 'tslib') after adding @azure/ai-form-recognizer

JavascriptMick
Sun, 10 Dec 2023 13:00:00 +0000
Support

site: cheerful-taffy-0e7fae
framework: Nuxt3

Hi, my site is broken after deploying a recent change (which I tested extensively in my local environment) to netlify. There are a couple of changes I think might be relevant

I added a new dependency to talk to azure document intelligence… “@azure/ai-form-recognizer”: “^5.0.0”
tslib is a transitive dependency of @azure/ai-form-recognizer…I get this on my local setup…

npm list tslib
myapp_web@0.0.2 /Users/me/Workspace/folder/myapp_web
└─┬ @azure/ai-form-recognizer@5.0.0
  ├─┬ @azure/abort-controller@1.1.0
  │ └── tslib@2.6.2 deduped
  ├─┬ @azure/core-auth@1.5.0
  │ ├─┬ @azure/core-util@1.6.1
  │ │ └── tslib@2.6.2 deduped
  │ └── tslib@2.6.2 deduped
  ├─┬ @azure/core-client@1.7.3
  │ └── tslib@2.6.2 deduped
  ├─┬ @azure/core-lro@2.5.4
  │ └── tslib@2.6.2 deduped
  ├─┬ @azure/core-paging@1.5.0
  │ └── tslib@2.6.2 deduped
  ├─┬ @azure/core-rest-pipeline@1.12.2
  │ └── tslib@2.6.2 deduped
  ├─┬ @azure/core-tracing@1.0.1
  │ └── tslib@2.6.2 deduped
  ├─┬ @azure/logger@1.0.4
  │ └── tslib@2.6.2 deduped
  └── tslib@2.6.2

I had to add some rubbish to my tsconfig.json to make my prisma seeding thing work…

  "compilerOptions": {
    "types": ["node"]
  }

The build/deploy succeeds without any obvious error but when I access the site, this is the error I am now getting in the function logs…

Dec 10, 11:04:47 PM: 35d00016 ERROR  [nuxt] [request error] [unhandled] [500] Cannot find package 'tslib' imported from /var/task/.netlify/functions-internal/server/chunks/app/server.mjs
  at new NodeError (node:internal/errors:405:5)
  at packageResolve (node:internal/modules/esm/resolve:895:9)
  at moduleResolve (node:internal/modules/esm/resolve:988:20)
  at moduleResolveWithNodePath (node:internal/modules/esm/resolve:939:12)
  at defaultResolve (node:internal/modules/esm/resolve:1181:79)
  at nextResolve (node:internal/modules/esm/loader:163:28)
  at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
  at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
  at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
  at link (node:internal/modules/esm/module_job:76:36)

4 posts - 3 participants