Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation - Instructions on how to setup balm for Nuxt 3 #121

Open
TomMiller-mas opened this issue Mar 7, 2022 · 9 comments
Open

Documentation - Instructions on how to setup balm for Nuxt 3 #121

TomMiller-mas opened this issue Mar 7, 2022 · 9 comments

Comments

@TomMiller-mas
Copy link

I am new to Nuxt and balm and would appreciate it if someone has already done this, that they put instruction here. I will update them as I follow them with additional detail so they can eventually be used for documentation. Thanks!

@elf-mouse
Copy link
Member

Hi @TomMiller-mas ,

Currently nuxt3 is still in beta stage, so no UI integration solution is provided for now, you can refer to nuxt3 with BalmUI example to start your nuxt3 project

@TomMiller-mas
Copy link
Author

If you leave this open, I will try to make some notes from a newbie's point of view.

@TomMiller-mas
Copy link
Author

How to Install Balm-UI for nuxt.js v3 beta/rc:

Install nuxt v3
npx nuxi init <app name>

Install Balm-UI v10. As of this writing, v10 is still in development.
npm i balm-ui@next

WIP

@elf-mouse
Copy link
Member

  • config nuxt.config.ts

    import { defineNuxtConfig } from 'nuxt3';
    
    export default defineNuxtConfig({
      alias: {
        vue: 'vue/dist/vue.esm-bundler.js',
        'balm-ui-plus': 'balm-ui/dist/balm-ui-plus.esm.js'
      },
      css: ['balm-ui/dist/balm-ui.css'],
      ssr: false // for NOW
    });
  • add plugins/balm-ui.js

    import { defineNuxtPlugin } from '#app';
    import BalmUI from 'balm-ui';
    import BalmUIPlus from 'balm-ui-plus';
    
    export default defineNuxtPlugin((nuxtApp) => {
      nuxtApp.vueApp.use(BalmUI);
      nuxtApp.vueApp.use(BalmUIPlus);
    });

@tsrift
Copy link

tsrift commented Nov 28, 2022

With this sugessted configuration of nuxt.config.ts I got error:

Could not load ...\node_modules\vue\dist\vue.esm-bundler.js\server-renderer (imported by node_modules/nuxt/dist/core/runtime/nitro/renderer.mjs): ENOENT: no such file or directory, open '...\node_modules\vue\dist\vue.esm-bundler.js\server-renderer'

@tsrift
Copy link

tsrift commented Nov 28, 2022

  • config nuxt.config.ts
export default defineNuxtConfig({
    alias: {
        vue: 'vue/dist/vue.esm-bundler.js',
        'balm-ui-plus': 'balm-ui/dist/balm-ui-plus.esm.js'
    },
    css: ['balm-ui/dist/balm-ui.css'],
    ssr: false // for NOW
});

Could not load ...\node_modules\vue\dist\vue.esm-bundler.js\server-renderer (imported by node_modules/nuxt/dist/core/runtime/nitro/renderer.mjs): ENOENT: no such file or directory, open '...\node_modules\vue\dist\vue.esm-bundler.js\server-renderer'

@elf-mouse
Copy link
Member

Hi @tsrift , please update your nuxt.config.ts:

export default defineNuxtConfig({
  alias: {
    'balm-ui-plus': 'balm-ui/dist/balm-ui-plus.esm.js'
  },
  css: ['balm-ui/dist/balm-ui.css'],
  hooks: {
    'vite:extendConfig': (config, { isClient }) => {
      if (isClient) {
        config.resolve.alias.vue = 'vue/dist/vue.esm-bundler.js';
      }
    }
  },
  ssr: false
});

@jonaskahn
Copy link

Hi @elf-mouse . Can we use "ssr: true" for now ?

@elf-mouse
Copy link
Member

Hi @therealtuyen , you can try v10.22.0 again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants