# Module not found: Error: Can't resolve 'plugins/\*/hack'

**URL:** <https://discuss.elastic.co/t/module-not-found-error-cant-resolve-plugins-hack/218014>\
**Category:** Kibana\
**Created:** [February 5, 2020, 3:19pm UTC](https://discuss.elastic.co/t/module-not-found-error-cant-resolve-plugins-hack/218014 "2020-02-05T15:19:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marina\_Grechuhin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marina_grechuhin/32/62134_2.png) [@Marina\_Grechuhin](https://discuss.elastic.co/u/Marina_Grechuhin)\
**Post date:** [February 5, 2020, 3:19pm UTC](https://discuss.elastic.co/t/module-not-found-error-cant-resolve-plugins-hack/218014/1 "2020-02-05T15:19:26Z")

</div>

I'm generating a plugin code using:  
node scripts/generate\_plugin marina-test  
with only hacks enabled.  
And I keep getting the following error:  
Module not found: Error: Can't resolve 'plugins/marina\_test/hack' in '/kibana/src/optimize'

My kibana version is 6.6.2 and I've checked out tags/v6.6.2

What am I missing?

Thank you in advance, Marina

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [February 5, 2020, 8:00pm UTC](https://discuss.elastic.co/t/module-not-found-error-cant-resolve-plugins-hack/218014/2 "2020-02-05T20:00:54Z")

</div>

Do you have a `<plugin>/public/hack.js` file? Imports starting with `plugins/marina_test` are going to resolve to the `public` directory of the plugin with the id `marina_test`.

Also, it seems your plugin might have the id `marina-test` based on your comment. Double check the spelling of the "name" field in your `package.json` file, or the `id:` passed to the plugin constructor in your plugin's index.js file.

---

<div class="post-metadata">

**Author:** ![Marina\_Grechuhin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marina_grechuhin/32/62134_2.png) [@Marina\_Grechuhin](https://discuss.elastic.co/u/Marina_Grechuhin)\
**Post date:** [February 6, 2020, 6:25am UTC](https://discuss.elastic.co/t/module-not-found-error-cant-resolve-plugins-hack/218014/3 "2020-02-06T06:25:33Z")

</div>

Thank you, I had the hack.js file under server/public and even when I've updated the path in index.js file it didn't recognize it...

---

<div class="post-metadata">

**Author:** ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)\
**Post date:** [February 6, 2020, 3:38pm UTC](https://discuss.elastic.co/t/module-not-found-error-cant-resolve-plugins-hack/218014/4 "2020-02-06T15:38:59Z")

</div>

Ah, `public` is supposed to be next to `server`, not within it 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 5, 2020, 3:39pm UTC](https://discuss.elastic.co/t/module-not-found-error-cant-resolve-plugins-hack/218014/5 "2020-03-05T15:39:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
