Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

Bundle Error: Cannot find module

915 1
cancel
Showing results for 
Search instead for 
Did you mean: 
smallhillcz
4 - Data Explorer
4 - Data Explorer

Hi, I used the HelloWorld TypeScript example, installed and imported the @octokit/rest package to interact with GitHub and now I get the following error. The module is @octokit/rest present in the node_modules, vscode uses types from the package OK.

Is there some caveat on using third party NPM modules?

Running NodeJS 14 (per docs) and @airtable/blocks 1.18.1

 

$ block run --http
Updating bundle...
Bundle Error: Cannot find module '@octokit/rest' from '/workspaces/airtable-run-github-workflow/build/development/transpiled/user/frontend'

 Your block is running locally at http://localhost:9000

 

 

1 Reply 1
florence023
4 - Data Explorer
4 - Data Explorer

@smallhillcz wrote:

Hi, I used the HelloWorld TypeScript example, installed and imported the @octokit/rest package to interact with GitHub and now I get the following error. The module is @octokit/rest present in the node_modules, vscode uses types from the package OK. Lowes Life

Is there some caveat on using third party NPM modules?

Running NodeJS 14 (per docs) and @airtable/blocks 1.18.1

 

 

 

$ block run --http
Updating bundle...
Bundle Error: Cannot find module '@octokit/rest' from '/workspaces/airtable-run-github-workflow/build/development/transpiled/user/frontend'

 Your block is running locally at http://localhost:9000

 

 

 

 


Hello,

It sounds like you’re encountering a common issue with module resolution in your project. Here are a few steps to troubleshoot and resolve the problem:

Check Installation: Ensure that @octokit/rest is correctly installed in your project. Run:

 

 

npm install @octokit/rest

 

 

Verify Node Modules: Sometimes, the node_modules folder can get corrupted. Try deleting it and reinstalling all dependencies:

 

 

rm -rf node_modules
npm install

 

 

Check Path: Ensure that the path to the module is correct and that there are no typos in the import statement:

 

 

import { Octokit } from '@octokit/rest';

 

 

Update Dependencies: Make sure all your dependencies are up to date. Sometimes, compatibility issues can cause such errors:

 

 

npm update

 

 

Check Build Configuration: Ensure that your build configuration (e.g., Webpack, Babel) is correctly set up to handle third-party modules.
Clear Cache: Sometimes, clearing the npm cache can help resolve issues:

 

 

npm cache clean --force

 

 

Compatibility Issues: Verify that there are no compatibility issues between @octokit/rest, Node.js 14, and @airtable/blocks. Check the documentation and GitHub issues for any known problems.

Hope this will help you.
Best regards,
florence023