Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onDispose is not a function #186

Closed
wrmk opened this issue Aug 23, 2024 · 3 comments
Closed

onDispose is not a function #186

wrmk opened this issue Aug 23, 2024 · 3 comments

Comments

@wrmk
Copy link

wrmk commented Aug 23, 2024

Hi!

Recently I adapted the Rails project to compile CSS via esbuild, everything works great but I would like to reduce the time of the compilation. Because of that, I tried to use the embedded: true flag, but for some reason I've got the below error:

14:50:51 js_css.1 | ✘ [ERROR] [plugin sass-plugin] onDispose is not a function
14:50:51 js_css.1 | 
14:50:51 js_css.1 |     **/rails_project/node_modules/esbuild-sass-plugin/lib/render.js:35:8:
14:50:51 js_css.1 |       35 │         onDispose(compiler.dispose.bind(compiler));
14:50:51 js_css.1 |          ╵         ^
14:50:51 js_css.1 | 
14:50:51 js_css.1 |     at createCompiler (**/rails_project/node_modules/esbuild-sass-plugin/lib/render.js:35:9)
14:50:51 js_css.1 |     at async createRenderer (**/rails_projectnode_modules/esbuild-sass-plugin/lib/render.js:80:27)
14:50:51 js_css.1 |     at async setup (**/rails_project/node_modules/esbuild-sass-plugin/lib/plugin.js:52:32)
14:50:51 js_css.1 |     at async handlePlugins (**/rails_project/node_modules/esbuild/lib/main.js:897:11)

My plugin configuration:

sassPlugin({
  embedded: true,
  loadPaths: [
    "./node_modules",
  ],
  precompile: (source, pathname) => {
    return sassGlob(source, pathname);
  },
})

Maybe I'm doing something wrong, or there is a problem with the plugin, I don't know., but I'd like to start the conversation to get comments about this situation.

@dungjk
Copy link
Contributor

dungjk commented Oct 11, 2024

Hello @wrmk
Which version of esbuild you are using?.
If you're using esbuild with version before @0.17.2 you may need to upgrade it.

@wrmk
Copy link
Author

wrmk commented Oct 11, 2024

Hello @wrmk Which version of esbuild you are using?. If you're using esbuild with version before @0.17.2 you may need to upgrade it.

Hi! Yeah, my esbuild version is below 0.17.2. Will try, thank you.

@wrmk
Copy link
Author

wrmk commented Oct 11, 2024

Hello @wrmk Which version of esbuild you are using?. If you're using esbuild with version before @0.17.2 you may need to upgrade it.

Hi! Yeah, my esbuild version is below 0.17.2. Will try, thank you.

it works! much appreciate

@wrmk wrmk closed this as completed Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants