Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Commit 0295887

Browse files
Added notice of experimental module imports in README
1 parent b7e2813 commit 0295887

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ A sass module loader plugin for esbuild.
66
This plugin allows .scss and .sass files to be imported as modules in javascript
77
files.
88

9+
> Note: this package is a module.
10+
911
## Basic usge:
1012

1113
```js
@@ -22,6 +24,30 @@ await esb.build(
2224
);
2325
```
2426

27+
> Note: if you see an error in console like this:
28+
> ```js
29+
> node:internal/process/esm_loader:94
30+
> internalBinding('errors').triggerUncaughtException(
31+
> ^
32+
>
33+
> Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import 'node_modules\lodash\fp' is not supported resolving ES modules imported from node_modules\@squirrelnetwork\esbuild-sass-modules-plugin\src\esbuild-sass-modules-plugin.class.js
34+
> Did you mean to import lodash/fp.js?
35+
> at new NodeError (node:internal/errors:371:5)
36+
> at finalizeResolution (node:internal/modules/esm/resolve:412:17)
37+
> at moduleResolve (node:internal/modules/esm/resolve:932:10)
38+
> at defaultResolve (node:internal/modules/esm/resolve:1044:11)
39+
> at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
40+
> at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
41+
> at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
42+
> at link (node:internal/modules/esm/module_job:75:36) {
43+
> code: 'ERR_UNSUPPORTED_DIR_IMPORT',
44+
> url: 'file:///.../node_modules/lodash/fp'
45+
> }
46+
> ```
47+
> Then you need to
48+
> [add the flag](https://nodejs.org/api/cli.html#cli_experimental_specifier_resolution_mode)
49+
> `--experimental-specifier-resolution=node` when running node.
50+
2551
## Documentation
2652
2753
See the [wiki](https://github.com/Squirrel-Network/esbuild-sass-modules-plugin/wiki/)

0 commit comments

Comments
 (0)