Code Monkey home page Code Monkey logo

Comments (4)

Askhento avatar Askhento commented on May 18, 2024 1

I am just running the example without any changes.

Here is CSP i see :

<meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src ${webview.cspSource}; script-src 'nonce-${nonce}';">

from vscode-webview-ui-toolkit-samples.

hawkticehurst avatar hawkticehurst commented on May 18, 2024

Hey @Askhento!

Could you provide more context (and code snippets) on how you're trying to style the button?

The hello-svelte sample does actually enable the default script and style CSP rules (see here).

But reading the errors you sent it looks like there's something more going on since it's recommending that you set the script-src-elem rule and either set unsafe-inline or add a hash/nonce to your styles CSP as potential solutions to the errors you're seeing.

from vscode-webview-ui-toolkit-samples.

hawkticehurst avatar hawkticehurst commented on May 18, 2024

Ahhh I see, thanks for clarifying.

I installed a fresh copy of the hello-world-svelte sample and was able to partially reproduce the errors you're seeing:

  1. The button styling looks fine on my end –– in fact as I look back at your screenshot that button also looks correct, could you explain a bit more about the styling issue you're seeing?
  2. I did reproduce the style-src error and was reminded this is actually an issue with an upstream dependency of the toolkit but from all my testing it doesn't actually seem to result in any tangible problems when building an extension (just an annoying error that I think can be safely ignored)
  3. I could not reproduce the script-src error –– perhaps you should try to delete node_modules and reinstall (or maybe even delete and reinstall the entire sample?)

from vscode-webview-ui-toolkit-samples.

Askhento avatar Askhento commented on May 18, 2024

I've updated my launch.json

"args": [
  "--extensionDevelopmentPath=${workspaceFolder}",
  "--disable-extensions"
],

Seems like the color matched my theme, as should)
But still with fresh reinstall node_modules I see the same error with livereload.js. Seems like it comes from rollup-plugin-livereload.

from vscode-webview-ui-toolkit-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.