Storybook: Google Fonts module throws error when injected in nuxt-entry.js

Created on 23 Oct 2020  路  3Comments  路  Source: nuxt-community/storybook

Version

@nuxtjs/storybook: v.3.0.0
nuxt: v2.14.7

Reproduction Link

I don't unfortunately have a link as of yet

Steps to reproduce

Add google fonts to your nuxt.config.js:

  buildModules: [
    [
      '@nuxtjs/google-fonts',
      {
        families: {
          Inter: {
            wght: [400, 500, 600, 700],
          },
          Roboto: true,
        },
        display: 'swap',
        prefetch: true,
      },
    ]
  ],

What is Expected?

Storybook to not throw an error within the .nuxt-storybook/storybook/nuxt-entry.js and render correctly.

What is actually happening?

An error keeps getting thrown when executing plugin script:

/**
 * @nuxtjs/storybook
 * execute plugin scripts
 */
window.__NUXT__ = { config: {} }
(function(){var l=document.createElement('link');l.rel="stylesheet";l.href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto&display=swap";document.querySelector("head").appendChild(l);})();

Error in console:

nuxt-entry.js:14 Uncaught TypeError: {(intermediate value)} is not a function
    at Module.<anonymous> (nuxt-entry.js:14)
    at Module../.nuxt-storybook/storybook/nuxt-entry.js (nuxt-entry.js:224)
    at __webpack_require__ (bootstrap:853)
    at fn (bootstrap:150)
    at Module../.nuxt-storybook/storybook/entry.js (store.js:143)
    at __webpack_require__ (bootstrap:853)
    at fn (bootstrap:150)
    at Module../.storybook/storybook-init-framework-entry.js (preview.js-generated-config-entry.js:39)
    at __webpack_require__ (bootstrap:853)
    at fn (bootstrap:150)

Insights

When I remove from buildModules google fonts it works out of the gate.

bug

Most helpful comment

v3.1.0 is out 馃帀

All 3 comments

Hey @Sananes,
This should be fixed in #144, I will release the new version ASAP and ping you here 馃檪

Hey @Sananes,
This should be fixed in #144, I will release the new version ASAP and ping you here 馃檪

Thank you very much my good man!

v3.1.0 is out 馃帀

Was this page helpful?
0 / 5 - 0 ratings

Related issues

farnabaz picture farnabaz  路  6Comments

drewbaker picture drewbaker  路  5Comments

Elaniobro picture Elaniobro  路  3Comments

altryne picture altryne  路  4Comments

altryne picture altryne  路  3Comments