-
Notifications
You must be signed in to change notification settings - Fork 74
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
Getting botonic not defined which adding the script in index.html after hub deployment #2875
Comments
Hi @saketjiva it seems that for some reason process is not correctly evaluated when build is done. Can you give us extra info? Is this a project from scratch or you have done it with an example? |
Hi @vanbasten17 , Thank you for helping me! I have taken this example and my webpack version is 5.93 also below is the webpack.config.js const ROOT = path.resolve(__dirname, 'src') const OUTPUT_PATH = path.resolve(__dirname, 'dist') const BOTONIC_PATH = path.resolve( const WEBPACK_MODE = { const BOTONIC_TARGETS = { const WEBPACK_ENTRIES_DIRNAME = 'webpack-entries' const TEMPLATES = { const UMD_LIBRARY_TARGET = 'umd' function sourceMap(mode) { const optimizationConfig = { const resolveConfig = { const babelLoaderConfig = { function fileLoaderConfig(outputPath) { const nullLoaderConfig = { const stylesLoaderConfig = { const imageminPlugin = new ImageMinimizerPlugin({ function botonicDevConfig(mode) { function botonicWebchatConfig(mode) { function botonicWebviewsConfig(mode) { function botonicNodeConfig(mode) { module.exports = function (env, argv) { |
Try to convert from DefinePlugin to this: https://webpack.js.org/plugins/environment-plugin/ and deploy the bot again |
Below is my html and everything is working fine on http://localhost:8081/ but while embedding the script to html nothing working.
<title>Hotel Bot</title> <script type="text/javascript" src="https://hotel-76511a5f-2262-4a5a-9c0e-913b96b09dfd.netlify.app/webchat.botonic.js"></script> <script type="text/javascript"> document.addEventListener('DOMContentLoaded', function (event) { // Ensure Botonic is loaded before calling render if (typeof Botonic !== 'undefined') { Botonic.render(document.getElementById('root'), { appId: 'e7bfeedf-0944-478e-8263-4546baddb170' // visibility: 'dynamic', // Uncomment for enable dynamic settings (Botonic +0.12.0). }); } else { console.error('Botonic is not defined. Please check the script URL and network.'); } }); </script>In console getting error as
Uncaught ReferenceError: process is not defined
at 27218 (webchat.botonic.js:2:376700)
at webpack_require (webchat.botonic.js:2:1988702)
at 74575 (webchat.botonic.js:2:383772)
at webpack_require (webchat.botonic.js:2:1988702)
at 307 (webchat.botonic.js:2:413351)
at webpack_require (webchat.botonic.js:2:1988702)
at 74775 (webchat.botonic.js:2:506025)
at webpack_require (webchat.botonic.js:2:1988702)
at webchat.botonic.js:2:1990148
at webchat.botonic.js:2:1990241
Please help me on this.
The text was updated successfully, but these errors were encountered: