You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Javascript import generated by wrapHtml at elm-pages/generator/src/pre-render-html.js:43 breaks when building on Windows 10 due to platform-dependent behavior in path.join. Specifically, when I run elm-pages dev on Windows 10 and visit the dev server at https://localhost:1234, Chrome reports Uncaught TypeError: Failed to resolve module specifier "index.js". Relative references must start with either "/", "./", or "../". in the console. Firefox reports the same error. The error is due to a backslash in the import path (ex. import userInit from"\index.js";), which occurs because path.join uses backslashes to join paths on Windows.
Replacing path.join with path.posix.join in this instance seems to fix the problem by forcing the use of forward slashes in the generated path.
Software versions:
Node v16.8.0
Elm 0.19.1
elm-pages v2.1.9 (npm)
Chrome 92.0.4515.159
Firefox 91.0.2
Windows 10 version 21H1
The text was updated successfully, but these errors were encountered:
The Javascript import generated by
wrapHtml
at elm-pages/generator/src/pre-render-html.js:43 breaks when building on Windows 10 due to platform-dependent behavior inpath.join
. Specifically, when I runelm-pages dev
on Windows 10 and visit the dev server athttps://localhost:1234
, Chrome reportsUncaught TypeError: Failed to resolve module specifier "index.js". Relative references must start with either "/", "./", or "../".
in the console. Firefox reports the same error. The error is due to a backslash in the import path (ex.import userInit from"\index.js";
), which occurs becausepath.join
uses backslashes to join paths on Windows.Replacing
path.join
withpath.posix.join
in this instance seems to fix the problem by forcing the use of forward slashes in the generated path.Software versions:
Node v16.8.0
Elm 0.19.1
elm-pages v2.1.9 (npm)
Chrome 92.0.4515.159
Firefox 91.0.2
Windows 10 version 21H1
The text was updated successfully, but these errors were encountered: