question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: generate is not a function

See original GitHub issue

Description

The page-skeleton-webpack-plugin was installed and configured using the project generated by the @vue/cli 3.0 scaffold, but the skeleton screen could not be generated when the project was run.

使用@vue/cli 3.0脚手架生成的项目,安装并配置了page-skeleton-webpack-plugin,但是在运行项目时无法生成skeleton screen

Steps to reproduce

  1. Generate project using vue/cli 3.0
  2. Install page-skeleton-webpack-plugin and configure it in vue.config.js
  3. Execute npm run serve to run the project
  4. Open the console and click on Preview skeleton page
  5. An error has occurred 😭 -> “[PSG] generate is not a function”
  1. 使用vue/cli 3.0生成项目
  2. 安装page-skeleton-webpack-plugin,并在vue.config.js进行相应的配置
  3. 执行npm run serve运行项目
  4. 打开控制台,点击Preview skeleton page
  5. 出现错误😭 -> “[PSG] generate is not a function”

Expected behavior:

Correct generation of skeleton screen.

正确的生成skeleton screen

Actual behavior:

An error message 😭 -> “[PSG] generate is not a function” has occurred and the debug skeleton screen cannot be previewed.

出现了错误提示😭 -> “[PSG] generate is not a function”,无法预览调试skeleton screen

image

Plugin configration

const path = require('path');
const { SkeletonPlugin } = require('page-skeleton-webpack-plugin');

module.exports = {
  crossorigin: 'anonymous',
  integrity: true,
  configureWebpack: {
    plugins: [
      new SkeletonPlugin({
        pathname: path.resolve(__dirname, './shell'),
        staticDir: path.resolve(__dirname, './dist'),
        routes: ['/'],
      }),
    ],
  },
};

Versions

  • Page Skeleton: 0.10.12
  • Webpack: 4.17.1

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
jonelovemiracommented, Mar 7, 2019

css-tree版本太低,升级一下 npm i css-tree@1.0.0-alpha.29 就可以了

0reactions
neoma077commented, Jan 28, 2019

解决了么??

Read more comments on GitHub >

github_iconTop Results From Across the Web

create is not a function using useEffect React Hook with AJAX ...
Uncaught TypeError: create is not a function at commitHookEffectList (react-dom.development.js:15901) at commitPassiveHookEffects ...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
JavaScript: Uncaught TypeError: n is not a function
Uncaught TypeError: 'n' is not a function: This is a standard JavaScript error when trying to call a function before it is defined....
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
What Causes TypeError: "x" is not a function · A typographical error in a function call. · Missing script library. · When a...
Read more >
TypeError: require(...) is not a function in Node.js | bobbyhadz
To solve the "TypeError: require(...) is not a function", make sure to place a semicolon between your require call and an immediately invoked...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found