vue-cli-plugin-element-plus icon indicating copy to clipboard operation
vue-cli-plugin-element-plus copied to clipboard

Cannot read property 'replace' of undefined [bug fix]

Open tnnevol opened this issue 3 years ago • 8 comments

不知道是不是官方小伙独爱单引号, 麻烦修改一下正则吧

// ./node_modules/vue-cli-plugin-element-plus/generator/index.js:45:45 bug fix
// edit line 41
// error code
    const renderIndex = lines.findIndex(line => line.match(/createApp\(App\)(\.use\(\w*\))*\.mount\('#app'\)/))
// fix code
    const renderIndex = lines.findIndex(line => line.match(/createApp\(App\)(\.use\(\w*\))*\.mount\(['"]#app['"]\)/))

tnnevol avatar Apr 01 '21 07:04 tnnevol

I get same issue , 同样的问题+1.

CoolersCoder avatar Apr 03 '21 03:04 CoolersCoder

只能等官方修bug了吗?

HeliumTang avatar Apr 06 '21 09:04 HeliumTang

不知道是不是官方小伙独爱单引号, 麻烦修改一下正则吧

// ./node_modules/vue-cli-plugin-element-plus/generator/index.js:45:45 bug fix
// edit line 41
// error code
    const renderIndex = lines.findIndex(line => line.match(/createApp\(App\)(\.use\(\w*\))*\.mount\('#app'\)/))
// fix code
    const renderIndex = lines.findIndex(line => line.match(/createApp\(App\)(\.use\(\w*\))*\.mount\(['"]#app['"]\)/))

似乎还是报错

saltfishh avatar Apr 07 '21 21:04 saltfishh

遇到同样问题

pollux2015 avatar Apr 08 '21 07:04 pollux2015

这个正则还要求匹配 createApp,如果 createApp 在另外一行就不行了 image

LittleSound avatar Apr 12 '21 07:04 LittleSound

Can someone create a PR?

jdinartejesus avatar May 02 '21 10:05 jdinartejesus

Does anybody know why is it not merged yet?

dmytropryshliak avatar Jun 16 '21 14:06 dmytropryshliak

我也遇到相同的问题了 ERROR TypeError: Cannot read property 'replace' of undefined TypeError: Cannot read property 'replace' of undefined at D:\git\sailoudcodegit\unidownpage\node_modules\vue-cli-plugin-element-plus\generator\index.js:45:45 at runGenerator (C:\Users\censujiang\AppData\Roaming\npm\node_modules\@vue\cli\lib\invoke.js:132:13) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async invoke (C:\Users\censujiang\AppData\Roaming\npm\node_modules\@vue\cli\lib\invoke.js:92:3)

censujiang avatar Oct 02 '21 05:10 censujiang