[go: up one dir, main page]

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

@google-cloud/document-ai Typescript NodeJS Build Error #4906

Closed
localhostd3veloper opened this issue Dec 30, 2023 · 2 comments
Closed

@google-cloud/document-ai Typescript NodeJS Build Error #4906

localhostd3veloper opened this issue Dec 30, 2023 · 2 comments

Comments

@localhostd3veloper
Copy link
localhostd3veloper commented Dec 30, 2023

Environment details

  • which product (packages/*): @google-cloud/document-ai
  • OS: Ubuntu 22.04.3
  • Node.js version: v18.18.2
  • npm version: 9.8.1
  • google-cloud-node version:
    • @google-cloud/documentai: ^8.1.1

Steps to reproduce

I am using the client library for Document AI using Node.JS with the help of this url
https://cloud.google.com/document-ai/docs/samples/documentai-quickstart?hl=en#documentai_quickstart-nodejs

The project is working completely fine when running locally. But when building, it gives this error in one of the dependencies used by client library named as long -> 5.2.3

Actual Error while Building

image

The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("../index.js")' call instead

image

I am using tsc command to build the project
image

Thanks!

@sofisl
Copy link
Contributor
sofisl commented Jan 3, 2024

Hi @localhostd3veloper, I think this issue has to do with your typescript configuration. However, you shouldn't need to install those dependencies anyways since they're development dependencies. It looks like you're using .pnpm, could you try running: rm -rf node_modules && pnpm i --prod, then try rebuilding?

@sofisl
Copy link
Contributor
sofisl commented Jan 9, 2024

Going to close for now, feel free to reopen if it keeps being an issue!

@sofisl sofisl closed this as completed Jan 9, 2024
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