Skip to content

pnpm workspace monorepo方式导出报错 You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file #15955

@DreamPWJ

Description

@DreamPWJ

相关平台

微信小程序

小程序基础库: 3.4.7
使用框架: Vue 3

复现步骤

ModuleParseError: Module parse failed: Unexpected token (2:7)
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
| export { Http } from './http/http'

export type { HttpParams } from './types/http-params'
|

→ Watching... [2024/6/21 17:39:32]

node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^

[UnhandledPromiseRejection: 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(). The promise rejected with the reason "[object Array]".] {
code: 'ERR_UNHANDLED_REJECTION'
}

期望结果

正常加载 并支持monorepo方式

实际结果

无法导出通用包功能

环境信息

👽 Taro v3.6.32


  Taro CLI 3.6.32 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 20.14.0 - D:\Program Files\nodejs\node.EXE
      Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
      npm: 10.7.0 - D:\Program Files\nodejs\npm.CMD
    npmPackages:
      @tarojs/cli: 3.6.32 => 3.6.32 
      @tarojs/components: 3.6.32 => 3.6.32 
      @tarojs/helper: 3.6.32 => 3.6.32 
      @tarojs/plugin-framework-vue3: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-alipay: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-h5: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-jd: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-qq: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-swan: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-tt: 3.6.32 => 3.6.32 
      @tarojs/plugin-platform-weapp: 3.6.32 => 3.6.32 
      @tarojs/runtime: 3.6.32 => 3.6.32 
      @tarojs/shared: 3.6.32 => 3.6.32 
      @tarojs/taro: 3.6.32 => 3.6.32
      @tarojs/taro-loader: 3.6.32 => 3.6.32
      @tarojs/webpack5-runner: 3.6.32 => 3.6.32
      babel-preset-taro: 3.6.32 => 3.6.32
      eslint-config-taro: 3.6.32 => 3.6.32


补充信息

使用pnpm workspace方式

Metadata

Metadata

Assignees

No one assigned

    Labels

    F-vue3Framework - Vue 3V-3Version - 3.x

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions