Has anyone tried to build sveltekit with node-adap...
# support-questions-legacy
f
Has anyone tried to build sveltekit with node-adapter and using supertokens-web-js module? I`m getting a module not found when trying to build a docker-image to use in production, runs fine in development mode 🤔
r
How have you don the import in your code?
f
Copy code
import SuperTokens from 'supertokens-web-js';
    import Session from 'supertokens-web-js/recipe/session';
    import Passwordless from 'supertokens-web-js/recipe/passwordless';
r
right. So i think sweltekit is adding a
.js
to the imports on it's own which is causing the issue
try:
Copy code
import SuperTokens from 'supertokens-web-js';
    import Session from 'supertokens-web-js/recipe/session/index';
    import Passwordless from 'supertokens-web-js/recipe/passwordless/index';
f
actually tried that, no changes... got the same error, it`s looking for "......../passwordless.js" which doesnt exist
r
then try:
Copy code
import SuperTokens from 'supertokens-web-js';
    import Session from 'supertokens-web-js/recipe/session/index.js';
    import Passwordless from 'supertokens-web-js/recipe/passwordless/index.js';
f
think I tried that too... but will give it a shot
r
okay
f
same error...
ran the command this time on my machine instead of the docker build in case something weird was happening... but it produced the same errors
r
are you sure it's not taking the cached version? Cause it removing the
/index.js
and then adding a
.js
to the remainig string is weird..
f
yeah, thats what I was thinking, seems to be some caching...
r
yea.. just adding
/index
should just work.
We have had someone else complain about this in the past too.. and i think the solution was to just use
/index
f
Ok, thats what I figured as well, but since nothing changed I figured I would see if the comunity here had seen this. Hmm... guess I have to poke around to find out if there is caching somewhere...
r
Cool!
f
Thanks for your time though 🙂
r
Happy to help 🙂
t
@finnthehero you can append today's date -attempt
example
/index.js?190822-1
the browser will ignore anything after ?
but cache will not
f
Thanks will try that later tonight. Also raised this issue on the svelte discord server, but no replies there yet. Will definitely update this thread with the solution, when there is one 😊
t
you can try to open the index.js in incognito and see if the problem is/isn't there as well, unless your problem is caching in svelt itself as mentioned here https://stackoverflow.com/questions/65282261/how-can-i-force-client-to-not-cache-the-svelte-rollup-bundle-js
f
After looking at what was built in svelte, I realized I had more imports that was not corrected with the /index path, after fixing all the imports it worked as expected. 🙂 (just to give you guys an update) So this answer from rp fixed the issue, once I actually edited all the imports 😓 https://discord.com/channels/603466164219281420/1010175900492497027/1010177014885527595
5 Views