Impossible to use the Notes addon as a panel
See original GitHub issueDescribe the bug
Using the new configuration format, it is not possible to use the “Notes” addon as a panel anymore.
To Reproduce
Here is our main.js
, as documented here:
module.exports = {
stories: ['./stories/*.story.tsx'],
addons: [
'@storybook/addon-knobs',
'@storybook/addon-actions',
'@storybook/addon-a11y',
'@storybook/addon-notes/register-panel',
],
};
When starting up Storybook with start-storybook --config-dir storybook --port 9001 --static-dir .
, we get the following errors:
info @storybook/react v5.3.3
info
info => Loading static files from: /Users/astorije/my-repository .
info => Loading presets
WARN Failed to load preset: "@storybook/addon-notes/register-panel" on level 1
ERR! /Users/astorije/my-repository/node_modules/@storybook/components/node_modules/react-syntax-highlighter/dist/esm/languages/prism/jsx.js:1
ERR! import jsx from "refractor/lang/jsx.js";
ERR! ^^^^^^
ERR!
ERR! SyntaxError: Cannot use import statement outside a module
ERR! at Module._compile (internal/modules/cjs/loader.js:895:18)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
ERR! at Module.load (internal/modules/cjs/loader.js:815:32)
ERR! at Function.Module._load (internal/modules/cjs/loader.js:727:14)
ERR! at Module.require (internal/modules/cjs/loader.js:852:19)
ERR! at require (internal/modules/cjs/helpers.js:74:18)
ERR! at Object.<anonymous> (/Users/astorije/my-repository/node_modules/@storybook/components/dist/syntaxhighlighter/syntaxhighlighter.js:54:35)
ERR! at Module._compile (internal/modules/cjs/loader.js:959:30)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
ERR! at Module.load (internal/modules/cjs/loader.js:815:32)
ERR! at Function.Module._load (internal/modules/cjs/loader.js:727:14)
ERR! at Module.require (internal/modules/cjs/loader.js:852:19)
ERR! at require (internal/modules/cjs/helpers.js:74:18)
ERR! at Object.<anonymous> (/Users/astorije/my-repository/node_modules/@storybook/components/dist/index.js:218:26)
ERR! at Module._compile (internal/modules/cjs/loader.js:959:30)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
ERR! /Users/astorije/my-repository/node_modules/@storybook/components/node_modules/react-syntax-highlighter/dist/esm/languages/prism/jsx.js:1
ERR! import jsx from "refractor/lang/jsx.js";
ERR! ^^^^^^
ERR!
ERR! SyntaxError: Cannot use import statement outside a module
ERR! at Module._compile (internal/modules/cjs/loader.js:895:18)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
ERR! at Module.load (internal/modules/cjs/loader.js:815:32)
ERR! at Function.Module._load (internal/modules/cjs/loader.js:727:14)
ERR! at Module.require (internal/modules/cjs/loader.js:852:19)
ERR! at require (internal/modules/cjs/helpers.js:74:18)
ERR! at Object.<anonymous> (/Users/astorije/my-repository/node_modules/@storybook/components/dist/syntaxhighlighter/syntaxhighlighter.js:54:35)
ERR! at Module._compile (internal/modules/cjs/loader.js:959:30)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
ERR! at Module.load (internal/modules/cjs/loader.js:815:32)
ERR! at Function.Module._load (internal/modules/cjs/loader.js:727:14)
ERR! at Module.require (internal/modules/cjs/loader.js:852:19)
ERR! at require (internal/modules/cjs/helpers.js:74:18)
ERR! at Object.<anonymous> (/Users/astorije/my-repository/node_modules/@storybook/components/dist/index.js:218:26)
ERR! at Module._compile (internal/modules/cjs/loader.js:959:30)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) {
ERR! stack: '/Users/astorije/my-repository/node_modules/@storybook/components/node_modules/react-syntax-highlighter/dist/esm/languages/prism/jsx.js:1\n' +
ERR! 'import jsx from "refractor/lang/jsx.js";\n' +
ERR! '^^^^^^\n' +
ERR! '\n' +
ERR! 'SyntaxError: Cannot use import statement outside a module\n' +
ERR! ' at Module._compile (internal/modules/cjs/loader.js:895:18)\n' +
ERR! ' at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)\n' +
ERR! ' at Module.load (internal/modules/cjs/loader.js:815:32)\n' +
ERR! ' at Function.Module._load (internal/modules/cjs/loader.js:727:14)\n' +
ERR! ' at Module.require (internal/modules/cjs/loader.js:852:19)\n' +
ERR! ' at require (internal/modules/cjs/helpers.js:74:18)\n' +
ERR! ' at Object.<anonymous> (/Users/astorije/my-repository/node_modules/@storybook/components/dist/syntaxhighlighter/syntaxhighlighter.js:54:35)\n' +
ERR! ' at Module._compile (internal/modules/cjs/loader.js:959:30)\n' +
ERR! ' at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)\n' +
ERR! ' at Module.load (internal/modules/cjs/loader.js:815:32)\n' +
ERR! ' at Function.Module._load (internal/modules/cjs/loader.js:727:14)\n' +
ERR! ' at Module.require (internal/modules/cjs/loader.js:852:19)\n' +
ERR! ' at require (internal/modules/cjs/helpers.js:74:18)\n' +
ERR! ' at Object.<anonymous> (/Users/astorije/my-repository/node_modules/@storybook/components/dist/index.js:218:26)\n' +
ERR! ' at Module._compile (internal/modules/cjs/loader.js:959:30)\n' +
ERR! ' at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)'
ERR! }
info => Loading presets
WARN Failed to load preset: "@storybook/addon-notes/register-panel" on level 1
ERR! /Users/astorije/my-repository/node_modules/@storybook/components/node_modules/react-syntax-highlighter/dist/esm/languages/prism/jsx.js:1
ERR! import jsx from "refractor/lang/jsx.js";
ERR! ^^^^^^
ERR!
ERR! SyntaxError: Cannot use import statement outside a module
ERR! at Module._compile (internal/modules/cjs/loader.js:895:18)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
ERR! at Module.load (internal/modules/cjs/loader.js:815:32)
ERR! at Function.Module._load (internal/modules/cjs/loader.js:727:14)
ERR! at Module.require (internal/modules/cjs/loader.js:852:19)
ERR! at require (internal/modules/cjs/helpers.js:74:18)
ERR! at Object.<anonymous> (/Users/astorije/my-repository/node_modules/@storybook/components/dist/syntaxhighlighter/syntaxhighlighter.js:54:35)
ERR! at Module._compile (internal/modules/cjs/loader.js:959:30)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
ERR! at Module.load (internal/modules/cjs/loader.js:815:32)
ERR! at Function.Module._load (internal/modules/cjs/loader.js:727:14)
ERR! at Module.require (internal/modules/cjs/loader.js:852:19)
ERR! at require (internal/modules/cjs/helpers.js:74:18)
ERR! at Object.<anonymous> (/Users/astorije/my-repository/node_modules/@storybook/components/dist/index.js:218:26)
ERR! at Module._compile (internal/modules/cjs/loader.js:959:30)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
ERR! /Users/astorije/my-repository/node_modules/@storybook/components/node_modules/react-syntax-highlighter/dist/esm/languages/prism/jsx.js:1
ERR! import jsx from "refractor/lang/jsx.js";
ERR! ^^^^^^
ERR!
ERR! SyntaxError: Cannot use import statement outside a module
ERR! at Module._compile (internal/modules/cjs/loader.js:895:18)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
ERR! at Module.load (internal/modules/cjs/loader.js:815:32)
ERR! at Function.Module._load (internal/modules/cjs/loader.js:727:14)
ERR! at Module.require (internal/modules/cjs/loader.js:852:19)
ERR! at require (internal/modules/cjs/helpers.js:74:18)
ERR! at Object.<anonymous> (/Users/astorije/my-repository/node_modules/@storybook/components/dist/syntaxhighlighter/syntaxhighlighter.js:54:35)
ERR! at Module._compile (internal/modules/cjs/loader.js:959:30)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
ERR! at Module.load (internal/modules/cjs/loader.js:815:32)
ERR! at Function.Module._load (internal/modules/cjs/loader.js:727:14)
ERR! at Module.require (internal/modules/cjs/loader.js:852:19)
ERR! at require (internal/modules/cjs/helpers.js:74:18)
ERR! at Object.<anonymous> (/Users/astorije/my-repository/node_modules/@storybook/components/dist/index.js:218:26)
ERR! at Module._compile (internal/modules/cjs/loader.js:959:30)
ERR! at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) {
ERR! stack: '/Users/astorije/my-repository/node_modules/@storybook/components/node_modules/react-syntax-highlighter/dist/esm/languages/prism/jsx.js:1\n' +
ERR! 'import jsx from "refractor/lang/jsx.js";\n' +
ERR! '^^^^^^\n' +
ERR! '\n' +
ERR! 'SyntaxError: Cannot use import statement outside a module\n' +
ERR! ' at Module._compile (internal/modules/cjs/loader.js:895:18)\n' +
ERR! ' at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)\n' +
ERR! ' at Module.load (internal/modules/cjs/loader.js:815:32)\n' +
ERR! ' at Function.Module._load (internal/modules/cjs/loader.js:727:14)\n' +
ERR! ' at Module.require (internal/modules/cjs/loader.js:852:19)\n' +
ERR! ' at require (internal/modules/cjs/helpers.js:74:18)\n' +
ERR! ' at Object.<anonymous> (/Users/astorije/my-repository/node_modules/@storybook/components/dist/syntaxhighlighter/syntaxhighlighter.js:54:35)\n' +
ERR! ' at Module._compile (internal/modules/cjs/loader.js:959:30)\n' +
ERR! ' at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)\n' +
ERR! ' at Module.load (internal/modules/cjs/loader.js:815:32)\n' +
ERR! ' at Function.Module._load (internal/modules/cjs/loader.js:727:14)\n' +
ERR! ' at Module.require (internal/modules/cjs/loader.js:852:19)\n' +
ERR! ' at require (internal/modules/cjs/helpers.js:74:18)\n' +
ERR! ' at Object.<anonymous> (/Users/astorije/my-repository/node_modules/@storybook/components/dist/index.js:218:26)\n' +
ERR! ' at Module._compile (internal/modules/cjs/loader.js:959:30)\n' +
ERR! ' at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)'
ERR! }
info => Loading config/preview file in "storybook".
info => Adding stories defined in "storybook/main.js".
Storybook starts up but the “Notes” tab is missing.
Expected behavior
We expect the “Notes” tab to appear as a panel when using the documented format:
When using the following main.js
:
module.exports = {
stories: ['./stories/*.story.tsx'],
addons: [
'@storybook/addon-knobs',
'@storybook/addon-actions',
'@storybook/addon-a11y',
'@storybook/addon-notes',
],
};
Storybook starts correctly and the “Notes” tab is available, but obviously not as a panel:
System:
Environment Info:
System:
OS: macOS Mojave 10.14.6
CPU: (8) x64 Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
Binaries:
Node: 12.14.0 - ~/.nvm/versions/node/v12.14.0/bin/node
Yarn: 1.21.1 - /usr/local/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.14.0/bin/npm
Browsers:
Safari: 12.1.2
npmPackages:
@storybook/addon-a11y: 5.3.3 => 5.3.3
@storybook/addon-actions: 5.3.3 => 5.3.3
@storybook/addon-knobs: 5.3.3 => 5.3.3
@storybook/addon-notes: 5.3.3 => 5.3.3
@storybook/addons: 5.3.3 => 5.3.3
@storybook/node-logger: 5.3.3 => 5.3.3
@storybook/react: 5.3.3 => 5.3.3
@storybook/theming: 5.3.3 => 5.3.3
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Addon knowledge base - Storybook - JS.ORG
This page details additional information about addon creation. Use it as a quick reference guide when creating your own addons. Disable the addon...
Read more >World of Warcraft Addons: You NEED to try HandyNotes! (Find ...
Download HandyNotes here! https://www.curseforge.com/wow/ addons /handynotesToday's Awesome Addon is one I've truly not appreciated enough, ...
Read more >Pin Notes - Addons - World of Warcraft - CurseForge
This addon allows you to create in-game groups of text notes attached to the borders of the screen, they can be opened and...
Read more >Awesome "Python Scripts & Notes" Panel
This is really an awesome AddOn! Makes your life so much easier when you work a lot with scripts. It would be awesome...
Read more >Unable to install add-ons (extensions or themes) | Firefox Help
An inability to install an extension can be the result of problems with the extension, Firefox preferences, or the version of Firefox you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Son of a gun!! I just released https://github.com/storybookjs/storybook/releases/tag/v5.3.5 containing PR #9497 that references this issue. Upgrade today to try it out!
I can confirm that v5.3.5 fixes the issue. Thanks @shilman! 🙏