# Cannot Import Module

**URL:** <https://discourse.joplinapp.org/t/cannot-import-module/24859>\
**Category:** Plugins\
**Created:** [3 April 2022 13:22 UTC](https://discourse.joplinapp.org/t/cannot-import-module/24859 "2022-04-03T13:22:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdelisle5](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jdelisle5](https://discourse.joplinapp.org/u/jdelisle5)\
**Post date:** [3 April 2022 13:22 UTC](https://discourse.joplinapp.org/t/cannot-import-module/24859/1 "2022-04-03T13:22:54Z")

</div>

I am new to plugin development and typescript. I want to create a plugin that syncs my google calendar events and such as notes; but I ran into some problems right away. I need to import a few modules: readline, http2, fs-extra.

Everything builds okay after running, npm install and npm run dist, but when I start the app in dev using "\AppData\Local\Programs\Joplin\Joplin.exe --env dev" the console throws an error saying Uncaught Error: Module readline cannot be found. I've tried everything I can think of and everything in this thread [generator-joplin: Module not found: Error: Can't resolve 'fs' · Issue #4372 · laurent22/joplin · GitHub](https://github.com/laurent22/joplin/issues/4372).

---

<div class="post-metadata">

**Author:** ![StructSeeker](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/structseeker/32/23446_2.png) [@StructSeeker](https://discourse.joplinapp.org/u/StructSeeker)\
**Post date:** [1 December 2024 23:49 UTC](https://discourse.joplinapp.org/t/cannot-import-module/24859/2 "2024-12-01T23:49:49Z")

</div>

See the following from `GENERATOR_DOC.md`

> ## External script files
> 
> By default, the compiler (webpack) is going to compile `src/index.ts` only (as well as any file it imports), and any other file will simply be copied to the plugin package. In some cases this is sufficient, however if you have [content scripts](https://joplinapp.org/api/references/plugin_api/classes/joplincontentscripts.html) or [webview scripts](https://joplinapp.org/api/references/plugin_api/classes/joplinviewspanels.html#addscript) you might want to compile them too, in particular in these two cases:
> 
> - The script is a TypeScript file - in which case it has to be compiled to JavaScript.
> 
> - The script requires modules you've added to package.json. In that case, the script, whether JS or TS, must be compiled so that the dependencies are bundled with the JPL file.
> 
> To get such an external script file to compile, you need to add it to the `extraScripts` array in `plugin.config.json`. The path you add should be relative to /src. For example, if you have a file in "/src/webviews/index.ts", the path should be set to "webviews/index.ts". Once compiled, the file will always be named with a .js extension. So you will get "webviews/index.js" in the plugin package, and that's the path you should use to reference the file.
