-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Custom addon not working on Windows. #10007
Comments
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
@jamime - did you ever resolve this? I'm also getting the "cannot use import statement outside module" error. |
TL;DR Explanation export const resolveAddonName = name => {
let path;
if (isLocalFileImport(name)) {
path = name;
} else {
({ path } = parsePackageName(name));
}
// when user provides full path, we don't need to do anything
if (path) {
return {
name,
// Accept `register`, `register.js`, `require.resolve('foo/register'), `register_panel`
type: path.match(/register(_panel)?(.js)?$/) ? 'managerEntries' : 'presets',
};
}
try {
return {
name: resolveFile(join(name, 'preset')),
type: 'presets',
};
// eslint-disable-next-line no-empty
} catch (err) {}
try {
return {
name: resolveFile(join(name, 'register')),
type: 'managerEntries',
};
// eslint-disable-next-line no-empty
} catch (err) {}
return { name, type: 'presets' };
}; Platform error is here: const isLocalFileImport = packageName => /^[./]/.test(packageName); Because Unix path starts with So |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
Describe the bug
I have a custom addon loaded from my
main.js
file. This works fine on Mac but fails on Windows with "Cannot use import statement outside a module". Looking at@storybook\core\dist\server\presets.js
, it's probablynode
related rather thanstorybook
but I wanted to check here first.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The plugin should load successfully.
System:
Additional context
storybook/lib/core/src/server/presets.js
Line 123 in 7c55dd1
It works fine on Mac
The text was updated successfully, but these errors were encountered: