Closed ckotzbauer closed 3 years ago
You have to set esModule: false
in html-loader options.
No idea why they changed the default option to true...
Thanks so much @elitastic! I've been limping along modifying aurelia-pal-browser to use the "default" property if the passed markup is a "Module" instead of string, but this is the correct fix.
Okay, this seems reasonable 😄 I will give it a try and close this issue, if it fixes my issue. Thanks!
Thanks, works as described!
I'm submitting a bug report
Please tell us about your environment:
Operating System:
Linux Ubuntu 21.04
Node Version: 15.13.0
NPM Version: 7.7.6
JSPM OR Webpack AND Version Webpack 5.38.1
Browser: Chrome latest
Language: TypeScript 4.3
Current behavior: I try to upgrade my build-stack to Webpack 5. The build succeeds currently, but if I open the app, I got an error, that I have to wrap Aurelia view-files in tags. I debugged into TextTemplateLoader (loadTemplate) from "aurelia-loader-webpack" and the "text" variable which is passed to the "createTemplateFromMarkup" function does not contain the html-text directly. It contains a "Module" with a "default" property which contains the text. Is this a known bug/behavior?
Expected/desired behavior: HTML-Modules are loaded correctly.
What is the expected behavior?
HTML-Modules are loaded correctly.
What is the motivation / use case for changing the behavior?