question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Browser-Importable Typings

See original GitHub issue

Hey all! I’m currently working on building an API using prisma2, and a website using React. Everything works fine until I go to load a type in React. Say for example I have a Category model, and I want to load that in a browser (since the types are already there) - I’m currently unable to do this.

Method of import:

import { Command } from "@prisma2/photon";

Error:

C:\Code\project\node_modules\@prisma\photon\runtime\index.js
Cannot find module: 'readline'. Make sure this package is installed.

Are there any plans to make it so types (I don’t need the specific methods like findMany, etc) are exposable/usable in a browser environment? Or is there any way I can work around this problem if browser support isn’t planned any time soon? Aside from manually writing my own types, ideally.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:34 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
matthewmuellercommented, Dec 14, 2020

I think this one can be closed with https://github.com/prisma/prisma/releases/tag/2.13.0. See: Import types and enums in the browser. Let us know if you run into any issues!

1reaction
flybayercommented, Nov 28, 2020

This is a notable UX issue in Blitz apps.

I think you could fix this by generating both a server entry point and a browser entry point, where the browser entry point only has the enum and client-safe code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Free Automated Malware Analysis Service - Hybrid Analysis
Submit malware for free analysis with Falcon Sandbox and Hybrid Analysis technology. Hybrid Analysis develops and licenses analysis tools to fight malware.
Read more >
mozilla-central: changeset 16951 ...
hidePopup(); -} - function BrowserImport() { #ifdef XP_MACOSX var wm ... for text when I start typing</a> - allows you to quickly navigate ......
Read more >
RazorSQL release history. - RSSing.com
... to File System BrowserImport Tool: Create table from import - table names ... Editor option for more easily typing languages such as...
Read more >
wiley-sketchup-for-interior-design-3d-visualizing ... - FlipHTML5
Import a Door through the Components BrowserImport a door component ... Move Geometry by Typing CoordinatesTo move a faraway piece of ...
Read more >
typings/typings - Gitter
typescript 2 support typings installation through npm here is the list: https://www.npmjs.com/~types. so why would i need to use typings module?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found