There's already a module with namespace
See original GitHub issueThe Ember.js application I work on is structured in ‘pods’.
This means that the stylesheet is co-located with the associated template and javascript.
For example
/my-component
/style.scss
/component.js
/template.hbs
When I recently attempted to migrate from @import
to @use
I get the error
There’s already a module with namespace “style”
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
SassError: There is no module with the namespace "math"
I'm having trouble getting the math SASS library to work in a Vue app. It compiles with Dart Sass, and sass-loader. The Dart...
Read more >Documentation - Namespaces and Modules - TypeScript
This post outlines the various ways to organize your code using modules and namespaces in TypeScript. We'll also go over some advanced topics...
Read more >"There is no module with the namespace" error when using ...
"There is no module with the namespace" error when using "<namespace>." syntax to access variables/functions if @use declaration is preceded with variable ...
Read more >The New SASS Module System: Out with @import, In with @use
In October of 2019 Sass announced their new module system, which primarily addressed the switch from using @import to @use instead.
Read more >Introducing Sass Modules - CSS-Tricks
Internal Sass features have also moved into the module system, so we have complete control over the global namespace. There are several ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That error occurs when attempting to
@use
two modules with the same namespace. The default namespace is the basename of the file passed to the@use
rule, so if you had something like:you would get this error because both of those rules use the namespace
style
. To fix this manually, you can use anas
clause to manually specify the namespace for a@use
rule. e.g.To make the migration easier, you can use the Sass migrator, which should automatically add
as
clauses when necessary (it will also automatically add these namespaces to any variable, mixin, or function references from other files, so you don’t have to do that manually either). If you already used the migrator and the stylesheets it output resulted in this error, then that’s a bug with it, and you should file an issue here.Thanks @nex3, that helps a little, apart from this use case:
…but I can probably live with that.
In case it’s not clear, the above is required because this doesn’t work for the two reasons mentioned in the comments: