Comments (11)
Hi @liangshengzhong!
Thanks for reporting. Let us take a look at this issue once we're done with the higher priority tickets.
Could you clarify the following questions:
- Did you try using this rest client for the first time? If not, has there been this problem before?
- As far as I know
process.env
not present in browser. Could this be the cause of the error? - Also, could you please share information about the browser you are using?
Thank you
from typed-rest-client.
@liangshengzhong
This library can be used only with Node.js runtime. typed-rest-client is written based on the http and https modules from the Node.
Browser support can be implemented by third-party utilities that replace the implementation of the necessary modules from Node
from typed-rest-client.
It will be helpful if you provide a minimal example that reproduced this issue
from typed-rest-client.
Hi @liangshengzhong! Thanks for reporting. Let us take a look at this issue once we're done with the higher priority tickets. Could you clarify the following questions:
- Did you try using this rest client for the first time? If not, has there been this problem before?
Yes, this is the first time we are trying to use this package in our projects- As far as I know
process.env
not present in browser. Could this be the cause of the error?
I think so, so can you confirm that this is a nodejs only library, or if it supports both browsers and nodejs? I can not get any information about this in document. But I saw there is a react example in sample- Also, could you please share information about the browser you are using?
I am using Chrome version 103.0.5060.114 (Official Build) (arm64)
Thank you
from typed-rest-client.
@AndreyIvanov42 Thank you for your replyγ
- This library can be used only with Node.js runtime. typed-rest-client is written based on the http and https modules from the Node.
This means that by default typed-rest-client is a NodeJS only library, right?
- Browser support can be implemented by third-party utilities that replace the implementation of the necessary modules from Node
I would appreciate if you could recommend some third-party libraries that can implement that
from typed-rest-client.
@AndreyIvanov42
The code to reproduce the issue https://github.com/liangshengzhong/vue-typed-rest-client.
cd vue-typed-rest-client
npm install
npm run dev
from typed-rest-client.
Hi @liangshengzhong
@KonstantinTyukalov will prepare samples for client use in the browser
from typed-rest-client.
Glad to hear that, thanks
from typed-rest-client.
@AndreyIvanov42 The code to reproduce the issue https://github.com/liangshengzhong/vue-typed-rest-client.
cd vue-typed-rest-client npm install npm run dev
Hi @liangshengzhong, could you try this workaround for vite config? - vitejs/vite#1973 (comment)
from typed-rest-client.
@KonstantinTyukalov The workaround resolves the the process does not define
error, but when I try to send a GET request, a new error occurs. I have updated the code to reproduce this error. https://github.com/liangshengzhong/vue-typed-rest-client
browser-external:path:9 Uncaught Error: Module "path" has been externalized for browser compatibility. Cannot access "path.posix" in client code.
at Object.get (browser-external:path:9:13)
at Object.getUrl (Util.js:25:26)
at RestClient.<anonymous> (RestClient.js:51:28)
at Generator.next (<anonymous>)
at RestClient.js:9:71
at new Promise (<anonymous>)
at __awaiter (RestClient.js:5:12)
at RestClient.get (RestClient.js:50:16)
at main.ts:10:31
from typed-rest-client.
This issue has had no activity in 90 days. Please comment if it is not actually stale
from typed-rest-client.
Related Issues (20)
- decompressGzippedContent : missing return when rejecting promise HOT 2
- How to reuse cookie in HttpClient HOT 1
- Sending body with delete request HOT 3
- Underscore 1.12.1 being used shows vulnerability https://npmjs.com/advisories/1674
- Possible regression in proxy variable processing HOT 4
- SyntaxError: Invalid regular expression: invalid group specifier name HOT 3
- Confusing deprecation: "1.8.5 contains changes that are not compatible with Node 6" HOT 3
- Update Azure pipeline and remove GitHub action HOT 2
- Authentication header is set on redirect request HOT 1
- ETIMEDOUT for certain calls on Node 16 HOT 5
- Performance issues with readBody in HttpClient.ts HOT 3
- error from zlib not handled properly in decompressGzippedContent() HOT 4
- This repo is missing important files
- Unable to read error message from response header HOT 3
- not working with react with next js , HOT 3
- Discussion: use with fetch API HOT 5
- Incorrect header check error while decompressing a response HOT 2
- Chrome 113 breaks typed-rest-client HOT 3
- Please tag released versions HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typed-rest-client.