Is Storybook comptible with Tamagui version ^1.2.9?
la55u opened this issue · comments
There was a recent PR that switches the outputted files from .js to .mjs. It is possible that it broke Storybook integration as discussed in this Discord thread. Are you able to confirm this? Thank you so much
For reference the errors look like this:
ModuleNotFoundError: Module not found: Error: Can't resolve './views/Text' in '/home/la/Projects/tamagui-kitchen-sink/node_modules/@tamagui/web/dist/esm'
Did you mean 'Text.mjs'?
BREAKING CHANGE: The request './views/Text' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
resolve './setupHooks' in '/Users/cassie/r/node_modules/@tamagui/web/dist/esm'
using description file: /Users/cassie/r/node_modules/@tamagui/web/package.json (relative path: ./dist/esm)
Field 'browser' doesn't contain a valid alias configuration
using description file: /Users/cassie/r/node_modules/@tamagui/web/package.json (relative path: ./dist/esm/setupHooks)
Field 'browser' doesn't contain a valid alias configuration
/Users/cassie/r/node_modules/@tamagui/web/dist/esm/setupHooks doesn't exist
[...]
ModuleNotFoundError: Module not found: Error: Can't resolve './views/FontLanguage' in '/Users/cassie/r/node_modules/@tamagui/web/dist/esm'
Did you mean 'FontLanguage.mjs'?
BREAKING CHANGE: The request './views/FontLanguage' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
at /Users/cassie/r/node_modules/webpack/lib/Compilation.js:2016:28
at /Users/cassie/r/node_modules/webpack/lib/NormalModuleFactory.js:798:13
Yes, looks like this broke storybook. I just updated tamagui to the latest version recently.
@la55u I finally could find the issue to fix the build please see the latest changes in preview-head.html
and main.ts
of Storybook