Code Monkey home page Code Monkey logo

Comments (8)

userquin avatar userquin commented on May 28, 2024 1

what's you moduleResolution entry in the tsconfig.json file? Can you try with .default() suffix on uni?

from unocss.

userquin avatar userquin commented on May 28, 2024

try adding type module to your package.json or rename vite config to .mjs/.mts

https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only

from unocss.

sugar258596 avatar sugar258596 commented on May 28, 2024

尝试将类型模块添加到 package.json 或将 vite 配置重命名为 .mjs/.mts

https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only

It's configured, but there's still an error

from unocss.

sugar258596 avatar sugar258596 commented on May 28, 2024

尝试将类型模块添加到 package.json 或将 vite 配置重命名为 .mjs/.mts

https://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only
This error occurs when you change the ts file to mts
image

from unocss.

sugar258596 avatar sugar258596 commented on May 28, 2024

tsconfig.json 文件中的 moduleResolution 条目是什么?你可以尝试.default()在uni上使用后缀吗?

image

from unocss.

userquin avatar userquin commented on May 28, 2024

@dcloudio/* seems to be only CJS and the plugin doesn't have types:

from unocss.

userquin avatar userquin commented on May 28, 2024

add console.log(uni.default || uni) before export default defineConfig({ and run dev or build script...

from unocss.

sugar258596 avatar sugar258596 commented on May 28, 2024

add console.log(uni.default || uni) before export default defineConfig({ and run dev or build script...

I refer to the dcloudio/uni-app#4815, seems can be solved,Thank you very much for your answer

from unocss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.