storybook: [Bug]: Invalid binary plist error with Storybook 7 beta

Describe the bug

I am trying to update a NextJS project to use Storybook 7 beta but when I attempt to run pnpm storybook on my Macbook M1 I am greeted with the following error:

/Users/me/Projects/next-tailwind/node_modules/.pnpm/bplist-parser@0.2.0/node_modules/bplist-parser/bplistParser.js:55
    throw new Error("Invalid binary plist. Expected 'bplist' at offset 0.");
          ^

Error: Invalid binary plist. Expected 'bplist' at offset 0.
    at Object.exports.parseBuffer (/Users/me/Projects/next-tailwind/node_modules/.pnpm/bplist-parser@0.2.0/node_modules/bplist-parser/bplistParser.js:55:11)
    at Module.defaultBrowserId (file:///Users/me/Projects/next-tailwind/node_modules/.pnpm/default-browser-id@3.0.0/node_modules/default-browser-id/index.js:27:22)
    at async module.exports (/Users/me/Projects/next-tailwind/node_modules/.pnpm/@aw-web-design+x-default-browser@1.4.88/node_modules/@aw-web-design/x-default-browser/src/detect-mac.js:4:14)
 ELIFECYCLE  Command failed with exit code 1.

This is using the @storybook/react-webpack5.

To Reproduce

Repo here: https://github.com/robcaldecott/next-tailwind/tree/storybook-7-beta


git clone git@github.com:robcaldecott/next-tailwind.git -b storybook-7-beta
cd next-tailwind
pnpm install
pnpm storybook

If you do not have pnpm then install with npm install -g pnpm. However, a separate project that uses npm exhibits the same issue so I don’t think pnpm is a factor here.



### System

```shell
System:
    OS: macOS 12.6.1
    CPU: (10) arm64 Apple M1 Pro
  Binaries:
    Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm
  Browsers:
    Chrome: 109.0.5414.119
    Firefox: 109.0
    Safari: 16.1
  npmPackages:
    @storybook/addon-actions: ^7.0.0-beta.44 => 7.0.0-beta.44 
    @storybook/addon-essentials: ^7.0.0-beta.44 => 7.0.0-beta.44 
    @storybook/addon-interactions: ^7.0.0-beta.44 => 7.0.0-beta.44 
    @storybook/addon-links: ^7.0.0-beta.44 => 7.0.0-beta.44 
    @storybook/addon-postcss: ^2.0.0 => 2.0.0 
    @storybook/react: ^7.0.0-beta.44 => 7.0.0-beta.44 
    @storybook/react-webpack5: ^7.0.0-beta.44 => 7.0.0-beta.44 
    @storybook/testing-library: ^0.0.14-next.1 => 0.0.14-next.1

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 18 (8 by maintainers)

Most upvoted comments

@zhyd1997 I’ve fixed it!

  • I opened Safari and made it my default browser. File stayed as XML.
  • I opened Chrome and made it my default browser. File was converted to binary.
  • pnpm storybook now runs!

Thank you so much for your help ⭐

--no-open helps here. So this is definitely BE which needs to be fixed on storybook side. storybook dev -p 6006 --no-open -s public

The “toggle default browser, open it, and try again” worked for me too for anyone else coming across this issue… no idea why. (I use Safari/Safari Technology Preview as my default browser.)

I’ll report the CSS issues with @storybook/next as a separate issue.

@zhyd1997 Here it is

~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>LSHandlers</key>
	<array>
		<dict>
			<key>LSHandlerPreferredVersions</key>
			<dict>
				<key>LSHandlerRoleAll</key>
				<string>-</string>
			</dict>
			<key>LSHandlerRoleAll</key>
			<string>com.jamf.connect</string>
			<key>LSHandlerURLScheme</key>
			<string>jamfconnect</string>
		</dict>
		<dict>
			<key>LSHandlerContentType</key>
			<string>public.url</string>
			<key>LSHandlerPreferredVersions</key>
			<dict>
				<key>LSHandlerRoleViewer</key>
				<string>-</string>
			</dict>
			<key>LSHandlerRoleViewer</key>
			<string>com.google.chrome</string>
		</dict>
		<dict>
			<key>LSHandlerPreferredVersions</key>
			<dict>
				<key>LSHandlerRoleAll</key>
				<string>-</string>
			</dict>
			<key>LSHandlerRoleAll</key>
			<string>com.google.chrome</string>
			<key>LSHandlerURLScheme</key>
			<string>http</string>
		</dict>
		<dict>
			<key>LSHandlerPreferredVersions</key>
			<dict>
				<key>LSHandlerRoleAll</key>
				<string>-</string>
			</dict>
			<key>LSHandlerRoleAll</key>
			<string>starleaf.breeze2</string>
			<key>LSHandlerURLScheme</key>
			<string>starleaf</string>
		</dict>
		<dict>
			<key>LSHandlerPreferredVersions</key>
			<dict>
				<key>LSHandlerRoleAll</key>
				<string>-</string>
			</dict>
			<key>LSHandlerRoleAll</key>
			<string>starleaf.breeze2</string>
			<key>LSHandlerURLScheme</key>
			<string>breeze</string>
		</dict>
		<dict>
			<key>LSHandlerPreferredVersions</key>
			<dict>
				<key>LSHandlerRoleAll</key>
				<string>-</string>
			</dict>
			<key>LSHandlerRoleAll</key>
			<string>com.google.chrome</string>
			<key>LSHandlerURLScheme</key>
			<string>mailto</string>
		</dict>
		<dict>
			<key>LSHandlerPreferredVersions</key>
			<dict>
				<key>LSHandlerRoleAll</key>
				<string>-</string>
			</dict>
			<key>LSHandlerRoleAll</key>
			<string>com.google.chrome</string>
			<key>LSHandlerURLScheme</key>
			<string>https</string>
		</dict>
		<dict>
			<key>LSHandlerContentType</key>
			<string>public.html</string>
			<key>LSHandlerPreferredVersions</key>
			<dict>
				<key>LSHandlerRoleAll</key>
				<string>-</string>
			</dict>
			<key>LSHandlerRoleAll</key>
			<string>com.google.chrome</string>
		</dict>
		<dict>
			<key>LSHandlerPreferredVersions</key>
			<dict>
				<key>LSHandlerRoleAll</key>
				<string>-</string>
			</dict>
			<key>LSHandlerRoleAll</key>
			<string>us.zoom.xos</string>
			<key>LSHandlerURLScheme</key>
			<string>zoomphonecall</string>
		</dict>
		<dict>
			<key>LSHandlerPreferredVersions</key>
			<dict>
				<key>LSHandlerRoleAll</key>
				<string>-</string>
			</dict>
			<key>LSHandlerRoleAll</key>
			<string>com.tinyspeck.slackmacgap</string>
			<key>LSHandlerURLScheme</key>
			<string>slack</string>
		</dict>
		<dict>
			<key>LSHandlerPreferredVersions</key>
			<dict>
				<key>LSHandlerRoleAll</key>
				<string>-</string>
			</dict>
			<key>LSHandlerRoleAll</key>
			<string>com.docker.docker</string>
			<key>LSHandlerURLScheme</key>
			<string>docker-desktop</string>
		</dict>
		<dict>
			<key>LSHandlerPreferredVersions</key>
			<dict>
				<key>LSHandlerRoleAll</key>
				<string>-</string>
			</dict>
			<key>LSHandlerRoleAll</key>
			<string>com.google.chrome</string>
			<key>LSHandlerURLScheme</key>
			<string>webcal</string>
		</dict>
	</array>
</dict>
</plist>

The issue seems to be parsing my /Users/robert.caldecott/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure.plist file in the default-browser-id package. That file exists but the package does not like it.

I think it’s looking for the default browser. I have Chrome, Safari and Firefox installed with Chrome as the default.

I can also duplicate this by creating a brand new NextJS project and then adding Storybook.

pnpm create next-app [answer Yes to all prompts]
cd my-app
npx storybook@next init [answer Yes to all prompts]
pnpm storybook