-
Notifications
You must be signed in to change notification settings - Fork 145
Should tslib be a production dependency? #451
Comments
Hey @mtorp thanks for the bug report! Could you create and share a small reproduction of this bug? I've tried to reproduce it, but have been unable to do so at this point. |
Hi @hawkticehurst, I've haven't been able to reproduce the issue. I'm not sure what the problem was but it suddenly disappeared after I reran Sorry for reporting the issue before investigating it further. |
@mtorp no worries at all! Thanks for the update :) |
Hello, I am facing the same issue in release 1.2.2 (also happening with 1.2.1) See the first import in // Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { __decorate } from "tslib";
import { attr } from '@microsoft/fast-element';
import { Button as FoundationButton, buttonTemplate as template, } from '@microsoft/fast-foundation';
import { buttonStyles as styles } from './button.styles.js'; Visible at I am also getting the same issue with NB: I'm using yarn pnp |
Hey @FlorentHoareau, thanks for following up! Could you try to give specific steps to reproduce this issue? I have continued to be unable to reproduce this on my end. Also based on @mtorp's experience, perhaps you might want to try reinstalling your dependencies. Maybe even delete node_modules (and/or your lock file) and then reinstall as well. |
Sure, you can reproduce it with these steps (I'm using node 18.x but I guess any would do):
Replace src/App.tsx with: import React from 'react';
import { VSCodeButton } from "@vscode/webview-ui-toolkit/react";
function App() {
return (
<VSCodeButton/>
);
}
export default App; and then
As a bonus you also get the issue with the missing "@microsoft/fast-web-utilities" that I listed in my previous message. NB: with this template, you also get an error from eslint, but it's not related. Hope this helps. |
I'm currently solving this issue by adding a Add in packageExtensions:
"@vscode/webview-ui-toolkit@*":
dependencies:
"@microsoft/fast-web-utilities": ^6.0.0
tslib: ^2.1.0 And then run
And it will work without errors. |
Thank you so much, this does help! I'm following the steps now and ran into an issue when trying to run: yarn dlx create-react-app --template typescript vscode-webview-ui-tooklit-tslib-issue The error reported: yarn run v1.22.19
error Couldn't find a package.json file in "/some/folder/path/on/my/computer"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Did you run into this at all and/or have any thoughts on why that might be showing up? A bit confused because |
Which version of |
And yes basically |
Nice, the wrong version of yarn was the issue. Thank you for the catch! I was able to reproduce the issue, so I'm happy to reopen this and put it on the list of things to fix. As some general expectation setting, however, I've been mentioning to everyone that the toolkit is really tightly resourced at this time (myself and one other person split our time between this project and a handful of others), so it might take longer than usual to tackle this. With that said, I'm hopeful that switching |
Thanks again for the follow-up and reproduction steps! |
Thanks for your followup and no worries for the time it takes since the fix on user-side is easy enough. By the way it all comes from @attr public appearance: ButtonAppearance; But I don't see anywhere where you actually use the |
Awesome, thanks for understanding :) Also oh yeah Regardless, it's great to know that |
Sorry it took so long but |
Describe the bug
When I try to import VSCodeButton (
import { VSCodeButton } from '@vscode/webview-ui-toolkit/react';
), I'm getting the following error:In
./dist/button/index.js
there is an import of tslib (import { __decorate } from "tslib";
), but tslib is defined as dev dependency of vscode-webview-ui-toolkit.To reproduce
Run the import as above
Desktop (please complete the following information):
I'm using pnpm version 7.5.2
The text was updated successfully, but these errors were encountered: