Browser-Importable Typings
See original GitHub issueHey 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:
- Created 4 years ago
- Reactions:1
- Comments:34 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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!
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.