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

Source map issue in generated client (5.13.0) #23955

Open
mastersilv3r opened this issue Apr 24, 2024 · 2 comments
Open

Source map issue in generated client (5.13.0) #23955

mastersilv3r opened this issue Apr 24, 2024 · 2 comments
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. topic: prisma generate CLI: prisma generate topic: prisma-client

Comments

@mastersilv3r
Copy link

Bug description

This used to work perfectly till Prisma 5.11.0
When I generate client using prisma generate command, the generated client has now started giving this issue.

Source Map Issue (Compile time)

When building (transpiling) my project which has generated prisma client, the below mentioned error shows up.
Workaround
To stop this error from showing up - disable generation of source map in .swcrc or tsconfig.json
Error log

ERROR  failed to read input source map: failed to parse inline source map url
index-browser.js.map

Caused by:
    relative URL without a base
    at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.274.0/src/lib.rs:386

  ERROR  failed to read input source map: failed to parse inline source map url
edge.js.map

Caused by:
    relative URL without a base
    at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.274.0/src/lib.rs:386

  ERROR  failed to read input source map: failed to parse inline source map url
library.js.map

Caused by:
    relative URL without a base
    at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.274.0/src/lib.rs:386

  ERROR  failed to read input source map: failed to parse inline source map url
edge-esm.js.map

Caused by:
    relative URL without a base
    at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.274.0/src/lib.rs:386

  ERROR  failed to read input source map: failed to parse inline source map url
react-native.js.map

Caused by:
    relative URL without a base
    at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.274.0/src/lib.rs:386

  ERROR  failed to read input source map: failed to parse inline source map url
wasm.js.map

Caused by:
    relative URL without a base
    at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.274.0/src/lib.rs:386

How to reproduce

Expected behavior

There should be no source mapping errors about relative URL like shown in the above error log.

Prisma information

datasource db {
  provider = "postgresql" // or "mysql", "sqlite", "sqlserver" etc.
  url      = env("POSTGRES_URL")
}

generator client {
  provider = "prisma-client-js"
  output   = "./prisma-clients/lending_service_db"
  previewFeatures = ["metrics"]
}

model User {
  id               Int               @id @default(autoincrement())
  pan_number            String            @unique ///@encrypted
  // password         String            ///@encrypted
  // name             String?
  loanApplications LoanApplication[]
}

model LoanApplication {
  id             Int             @id @default(autoincrement())
  createdAt      DateTime        @default(now())
  updatedAt      DateTime        @updatedAt
  status         String          // e.g. "pending", "approved", "rejected"
  amount         Float
  interest       Float
  duration       Int
  bank_name      String
  userId         Int             // Foreign key to associate with User
  // loanProductId  Int             // Foreign key to associate with LoanProduct
  user           User            @relation(fields: [userId], references: [id])
  // loanProduct    LoanProduct     @relation(fields: [loanProductId], references: [id])
}
N/A

Environment & setup

  • OS: Ubuntu
  • Database: Postgres
  • Node.js version: 21.5.0
  • Prisma and client version: 5.13.0

Prisma Version

prisma                  : 5.13.0
@prisma/client          : 5.13.0
Computed binaryTarget   : debian-openssl-3.0.x
Operating System        : linux
Architecture            : x64
Node.js                 : v21.5.0
Query Engine (Node-API) : libquery-engine b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b (at node_modules/@prisma/engines/libquery_engine-debian-openssl-3.0.x.so.node)
Schema Engine           : schema-engine-cli b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b (at node_modules/@prisma/engines/schema-engine-debian-openssl-3.0.x)
Schema Wasm             : @prisma/prisma-schema-wasm 5.13.0-23.b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b
Default Engines Hash    : b9a39a7ee606c28e3455d0fd60e78c3ba82b1a2b
Studio                  : 0.500.0
@mastersilv3r mastersilv3r added the kind/bug A reported bug. label Apr 24, 2024
@Jolg42 Jolg42 added the bug/2-confirmed Bug has been reproduced and confirmed. label Apr 25, 2024
@janpio janpio added the team/client Issue for team Client. label Apr 25, 2024
@Jolg42
Copy link
Member

Jolg42 commented Apr 25, 2024

I just noticed this in our CI today as well. I did not check yet if this happens with earlier versions of Prisma.

https://github.com/prisma/prisma/actions/runs/8829073928/job/24239396015#step:13:57

  ERROR  failed to read input source map: failed to parse inline source map url
index.js.map

Caused by:
    relative URL without a base
    at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc-0.274.0/src/lib.rs:386

From what I see, it's not causing any problem, but that's an ugly error message. @mastersilv3r Is that what you obverse, too?

@Jolg42
Copy link
Member

Jolg42 commented Apr 25, 2024

I suspect that this is related to swc-project/swc#8869 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/client Issue for team Client. topic: prisma generate CLI: prisma generate topic: prisma-client
Projects
None yet
Development

No branches or pull requests

3 participants