Closed evayde closed 4 years ago
Issue can be closed.
This error was caused by the following configuration.
I had the following config in next.config.js
:
webpack: (config, { isServer }) => {
if (!isServer) {
config.externals = {
"i18next-express-middleware": "{}",
"./config": "{}",
};
}
return config;
},
and this line:
"./config": "{}",
was overwriting imports from swr.
Hello there,
The Error
I am getting the following error message:
My Setup
I get this error with the following packages:
NodeJS 12, yarn 1.21.1, typescript 3.7.2
Reproduction
I am getting this error implementing the
axios-typescript
andbasic-typescript
examples. I copied the files from lib into my page and copied the lines from the example page as well.for example
The
useRequest
hook does also throw a type error, as described here: https://github.com/zeit/swr/issues/238Expected behavior
Hook wouldnt throw an error and would respond with my api's data. Btw. calling
http://localhost:3000/api/posts
will respond with my data as expected and browser-fetch does work.