Closed frantz101 closed 6 years ago
Having a similar issue
(node:44212) UnhandledPromiseRejectionWarning: Error: Evaluation failed: ReferenceError: preview is not defined
at <anonymous>:1:1
at ExecutionContext.evaluateHandle (/usr/local/lib/node_modules/story2sketch/node_modules/puppeteer/lib/ExecutionContext.js:75:15)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:118:7)
(node:44212) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:44212) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Hi @frantz101, this is usually caused by issues in the webpack config, and I think I can see the issue with yours.
In your webpack.config.js
, you're defining newConfig
, adding the library
parameter to output
correctly, but not returning it. I would suggest updating it to:
const path = require("path");
// Export a function. Accept the base config as the only param.
module.exports = (storybookBaseConfig, configType) => {
// configType has a value of 'DEVELOPMENT' or 'PRODUCTION'
// You can change the configuration based on that.
// 'PRODUCTION' is used when building the static version of storybook.
// Make whatever fine-grained changes you need
const newConfig = {
...storybookBaseConfig
};
newConfig.module.rules.push({
test: /\.handlebars$/,
loaders: ["handlebars-loader"],
include: path.resolve(__dirname, "../")
});
// Add this:
// Export bundles as libraries so we can access them on page scope.
newConfig.output.library = "[name]";
// Return the altered config
return newConfig;
};
Let me know if that helps. @mariarelian I would presume a similar issue with your webpack config - feel free to post below and I'll try to help debug.
That fixed my issue! thanks!
Great, going to close this issue.
@mariarelian if you still need help, please feel free to open another issue and I'll do my best to assist.
### experiencing problems as below
(node:14320) UnhandledPromiseRejectionWarning: Error: Evaluation failed: ReferenceError: getQrPng is not defined
at ExecutionContext._evaluateInternal (D:\data bot\wabot sahaja\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:172:23)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async ExecutionContext.evaluate (D:\data bot\wabot sahaja\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:107:16)
(Use node --trace-warnings ...
to show where the warning was created)
(node:14320) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14320) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I am trying to set up this tool, i followed the read me but getting "UnhandledPromiseRejectionWarning: Error: Evaluation failed: ReferenceError: preview is not defined" when i run the command line command. here's what my package.json looks like
and here's what my config files look like
webpack.config.js
thanks!