raindrop-fx icon indicating copy to clipboard operation
raindrop-fx copied to clipboard

vue-cli 4.5项目导入出错

Open 1xu1 opened this issue 3 years ago • 4 comments

导入方式: import RaindropFX from "raindrop-fx";

错误信息:

error  in ./node_modules/raindrop-fx/dist/index.js

Module parse failed: Unexpected token (396:4320)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     vWorldPos = (uTransformM * vec4(aPos, 1)).xyz;\r
|     vSize = aSize;\r`
······
| /*! *****************************************************************************
| Copyright (C) Microsoft. All rights reserved.

 @ ./node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/ts-loader??ref--14-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader-v16/dist??ref--0-1!./src/components/background/Background.vue?vue&type=script&lang=ts 6:0-37 35:25-35

这是咋回事啊大佬

1xu1 avatar Oct 17 '21 07:10 1xu1

是 NPM 上的版本么?

SardineFish avatar Oct 17 '21 17:10 SardineFish

是的,是npm安装的,版本是1.08

1xu1 avatar Oct 18 '21 01:10 1xu1

初步认定问题源于代码中使用的 ?. 运算符无法在 Vue 默认的项目构建设置下使用,鄙人才学疏浅,对 Vue 的构建配置了解不多,尚未能成功在 Vue 构建流中加入对 ?. 的支持。由于这个项目基于 esbuild 和 typescript,目前还没找到合适的解决方案在构建流中引入 babel,项目里诸如 ?. 这类 ESNext 的语法特性用的还不少(

可能需要额外抽时间对项目重构一下,如果你那边有找到相关解决方案,可以同步到这个 Issue 下

SardineFish avatar Oct 18 '21 15:10 SardineFish

I'm having the same problems with vue

sangyoo91 avatar May 07 '22 01:05 sangyoo91