#Should API route deps be downloaded and run in browser?
12 messages · Page 1 of 1 (latest)
I think this is the known issue there: https://github.com/BuilderIO/qwik/issues/1477
Thanks @terse forge
hmm normally the server deps are not used by the client callback functions and then they won't be imported. So if that's happening, check out the JS that was generated (the file in the browsers that shows the error, you'll have to turn off sourcemaps maybe) and try to figure out why the client callback has the server module in its dependency graph
I think this is the same issue linked above, it happens when using the Link component to navigate pages
Best way to know exactly what's going on is looking at the built .js files and seeing which ones try to import the wrong package
Yes, when using the Link component, all of the API routes and their dependencies are getting downloaded when a link is clicked.
so you need to find the first dep that does this. Perhaps it's indeed Link and the optimizer is confused about its server and client use, but you have to check
Ok, changing the Link to an a tag resolves the issue, can you give me a little more info on how to track down that generated file? (please pardon my mental slowness, I have covid, just starting to be functional again today)
I can give you access to the repo if that makes things easier?
Can you reproduce it in https://qwik.new ? Then it will be easier to sift through.
In any case, in the browser you should be able to see where the error arises. It will be coming from some js file that tries to import some server module. Figure out which code that is.
@steep ibex the linked issue contains a stackblitz looks like