Closed vtoropchin closed 4 years ago
I found that context.rendered not work
I have the same problem, how did you fix this?
Hello I suppose that problem there because the process variable is empty when script runs
@SerhiyP what process variable are you talking about? I have the same problem during ssr, on client-side requests are fine
I don't remember what was the problem
But you can try to set in webpack
target: 'node'
It might help you
@SerhiyP thanks for your response there is the reason why we don't have this in our webpack configuration, it breaks our logger ('fs' module issues) can you explain why target:node would fix axios issue? not really getting this...
Oh... Sorry For adapter, you should use
`import adapter from 'axios/lib/adapters/http'
axios(URL, { adapter: adapter }) `
@SerhiyP tried this, getting XMLHttpRequest is not defined
error when doing that
same as in this discussion: https://github.com/axios/axios/issues/2968
I don't know why this issue is closed.... I am getting the same error. one way to work around this, I guess is to use serversideProps in each individual page.
same error,how to fix it???
Oh... Sorry For adapter, you should use
`import adapter from 'axios/lib/adapters/http'
axios(URL, { adapter: adapter }) `
This answer worked for me perfectly fine and is definitely a lifesaver so Thanks for your contribution @SerhiyP . I'm grateful ❤️
MY USE CASE I am working on a vscode web extension which I want to work in desktop (nodejs) environment. Axios was throwing the exact same error for me. This fix helped me resolve this issue.
When sending a get request, the promise is redirected with an error:
TypeError: adapter is not a function at dispatchRequest (/Users/vladimir/Programming/GR/lawsystem.test/storage/app/ssr/28d918e4632a3b48ddcaf89db6812bd7.js:1058:10) TypeError: adapter is not a function at dispatchRequest (/Users/vladimir/Programming/GR/lawsystem.test/storage/app/ssr/28d918e4632a3b48ddcaf89db6812bd7.js:1058:10) at async Promise.all (index 0) "
webpack:
Here I make get request.
app.js
app-server.js
Version axios - 0.19.2 vue - 2.6.11 laravel-server-side-rendering = 1.3