I attempted to import npm packages while creating a custom React app extension, specifically chalk and d3-react-tree, for testing purposes. I added these packages to package.json using the notation “chalk”: “latest”, as outlined in the README, while working with the CRM private app template.
However, I encountered some issues: In Example.jsx, chalk only functions properly in the local environment (hs project dev) and fails when deployed (hs project upload). Additionally, in example-function.js, any attempt to import results in a script crash, regardless of whether I use import chalk from ‘chalk’; or const chalk = require(‘chalk’);.
Has anyone successfully imported regular npm packages besides the preloads when creating React crm extensions?