Code Monkey home page Code Monkey logo

Comments (11)

KonstantinTyukalov avatar KonstantinTyukalov commented on June 5, 2024

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.

AndreyIvanov42 avatar AndreyIvanov42 commented on June 5, 2024

@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.

AndreyIvanov42 avatar AndreyIvanov42 commented on June 5, 2024

It will be helpful if you provide a minimal example that reproduced this issue

from typed-rest-client.

liangshengzhong avatar liangshengzhong commented on June 5, 2024

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.

liangshengzhong avatar liangshengzhong commented on June 5, 2024

@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.

liangshengzhong avatar liangshengzhong commented on June 5, 2024

@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.

AndreyIvanov42 avatar AndreyIvanov42 commented on June 5, 2024

Hi @liangshengzhong
@KonstantinTyukalov will prepare samples for client use in the browser

from typed-rest-client.

liangshengzhong avatar liangshengzhong commented on June 5, 2024

Glad to hear that, thanks

from typed-rest-client.

KonstantinTyukalov avatar KonstantinTyukalov commented on June 5, 2024

@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.

liangshengzhong avatar liangshengzhong commented on June 5, 2024

@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.

github-actions avatar github-actions commented on June 5, 2024

This issue has had no activity in 90 days. Please comment if it is not actually stale

from typed-rest-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.