I am trying to run the latest version of <https://...
# help
l
I am trying to run the latest version of https://github.com/serverless-stack/demo-notes-app on Windows 11 and it fails to build. When I run
npx sst start
I get the following error:
Copy code
Preparing your SST app
X [ERROR] The entry point "C:\\...\\sst-demo-notes-app\\stacks\\index.js" cannot be marked as external

Build failed with 1 error:
error: The entry point "C:\\...\\sst-demo-notes-app\\stacks\\index.js" cannot be marked as external
This previously worked before the commit to "Update SST to v1". Any help will be greatly appreciated. Luke
k
@thdxr @Frank This is the same on windows 10. It seems the path filter for external modules is not effective for a windows path in node_modules\@serverless-stack\core\dist\stacks\build.js
t
will look at this hsortly
k
doing a layman's replacement seems to work for this step
Copy code
if(root.indexOf("C:\\")==0){
        entry = entry.replace(root+"\\", "./")
        entry = entry.replace("\\", "/")
    }
but then the process fails again later
This could perhaps be related to the resolveDirs also starting with "C:\", but I;m not sure how to fix this in the Esbuild callback
ah - no found a fix for part2 🙂 in
node_modules\@serverless-stack\cli\assets\debug-stack\bin\index.mjs
little patch
@thdxr
t
I wonder how this is working for non-windows, is nodejs including .mjs when you try to import .js ?
oh nvm I see the issue
there's a different way to fix this by doing
new URL(path).href
or something, it's annoying but I've had to find all places where we dynamically import so it works on windows
missed this one
k
great that there's a more elegant way 😉 after these 2 changes deployment worked for me on Windoze and I can now happily go back to WSL / Ubuntu 😜
t
hm that second file already has the fix I was referring to
were you maybe on an older version?
Copy code
// Validate the `debugStack` option in user SST app's index
const handler = await import(
  url.pathToFileURL(appBuildLibPath + "/index.js").href
);
@Luke Stock can you try
sst update snapshot
and see if that works
k
@thdxr just giving it a try again on W10 with the snapshot and it seem to work fine now. When installing from the cloned repo, I didn't do an explicit
npx sst update
Perhaps this explains why I didn't have the fix you mentioned included before.
huge compliments for your superb speed of rolling out fixes btw. I feel this makes the SST team quite unique.
l
@thdxr Yes this now works. Thank you for your help. Sorry we had a long bank holiday here in the UK and I took an extended break so I've just got back.