question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when parsing dynamic attributes expressions

See original GitHub issue

I have the following code:

<script>
    import Typewritter from './Typewritter.svelte'
    const texts = ['text1', 'text2']
</script>

<div class="parallax-cover">
    <h1>Random Title</h1>
    <Typewritter {texts} />     <!-- This will be formatted -->
</div>

I use the npm run format command and the result is:

<script>
    import Typewritter from './Typewritter.svelte'
    const texts = ['text1', 'text2']
</script>

<div class="parallax-cover">
    <h1>Random Title</h1>
    <Typewritter texts="texts" />   <!-- The expected result was texts="{texts}" -->
</div>

This changes the expected result, because you are assigning the text string “texts”, not the variable texts.

Additional information

"scripts": {
        "start": "sirv public",
        "autobuild": "rollup -c -w",
        "dev": "run-p watch:tailwind autobuild",
        "build": "npm run build:tailwind && rollup -c",
        "format": "prettier --write \"{,!(public)/**/}*.{js,json,svelte}\"",
        "watch:tailwind": "postcss src/tailwind.css -o public/global.css -w",
        "build:tailwind": "cross-env NODE_ENV=production postcss src/tailwind.css -o public/global.css"
    },
"dependencies": {
        "sirv-cli": "^1.0.3"
    },
    "devDependencies": {
        "@fullhuman/postcss-purgecss": "^2.3.0",
        "@rollup/plugin-commonjs": "^14.0.0",
        "@rollup/plugin-node-resolve": "^8.4.0",
        "cross-env": "^7.0.2",
        "cssnano": "^4.1.10",
        "npm-run-all": "^4.1.5",
        "postcss-cli": "^7.1.1",
        "prettier": "^2.0.5",
        "prettier-plugin-svelte": "^1.1.0",
        "rollup": "^2.21.0",
        "rollup-plugin-livereload": "^1.3.0",
        "rollup-plugin-svelte": "^5.2.3",
        "rollup-plugin-terser": "^6.1.0",
        "svelte": "^3.24.0",
        "svelte-preprocess": "^4.0.8",
        "tailwindcss": "^1.5.1"
    }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jesseskinnercommented, Aug 18, 2020

I’ve added a pull request which fixes this issue, #119.

1reaction
dummdidummcommented, Aug 31, 2020

I updated the docs a little. Yes, it overrules allowShortHand.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - System.Linq.Dynamic.DynamicExpression parsing ...
I have tried: a) using StringComparison but I get the error 'Unknown identifier 'StringComparison''. b) using the full namespace of System.
Read more >
[OSIsoft.AFSDK] Invalid dynamic attribute path - PI Square
It seems that the parsing logic within AFSDK does not anticipate a string literal or an environment variable substitution. Hence, we are unable...
Read more >
Troubleshoot dynamic groups - Active Directory | Microsoft Learn
This error means you have reached the max limit for Dynamic groups in your tenant. Check the number of groups in the tenant....
Read more >
XQuery, XSLT, and XPath Error Codes Namespace Document
It is a non-recoverable dynamic error if the effective value of the name attribute of an xsl:attribute instruction is not a lexical QName....
Read more >
The Standard Tag Library in the JSP Specification - InformIT
An error occurred while parsing custom action. Now for the fun part: The scripting language can also refer to beans and properties of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found