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.

Cannot create property 'tag' on string

See original GitHub issue

Hi, i want to try fre in js-framework-benchmark, but I get error - “Cannot create property ‘tag’ on string …”

version:

“fre”: 2.0.1

import { render  }  from "fre";

render(
    <div className="col-md-6"><h1>React Optimized</h1></div>,
    document.getElementById("main")
);

babel:

{
    presets: ['@babel/preset-env'],
    plugins: [[
        '@babel/plugin-transform-react-jsx',
        {
            runtime: 'automatic',
            importSource: 'fre',
        },
    ]]
}

First text node throw this error

(error throw on this line - https://github.com/yisar/fre/blob/master/src/reconciler.ts#L142)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
yisarcommented, Mar 20, 2021

It seems that the H function is not suitable for Babel’s jsx2 parsing. Before adjusting the H function, you can use the jsx1:

{
  "plugins": [
    [
      "@babel/plugin-transform-react-jsx",
      {
        "pragma": "h",
        "pragmaFrag": "Fragment"
      }
    ]
  ]
}

0reactions
yisarcommented, Jun 26, 2021

It seems that the problem here has been solved, I will close it first

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot create property on string - javascript - Stack Overflow
I had a similar error message TypeError: Cannot create property 'false' on boolean 'false' in Node 14.3.0 (ES 2019), using the new Javascript...
Read more >
TypeError: can't assign to property "x" on "y": not an object
The JavaScript strict mode exception "can't assign to property" occurs when attempting to create a property on primitive value such as a ...
Read more >
Getting "TypeError: Cannot create property 'value' on string"
trying to use "sn-record-picker" in a Ui page and getting this error. please Help. HTML: Angular controller: $scope.altCont={
Read more >
JavaScript TypeError - Can't assign to property "X" on "Y"
This JavaScript exception can't assign to property occurs in strict-mode only and this error occurs If the user tries to create a property...
Read more >
magento2 - Cannot create property 'cart' on string '{}lax'
The problem is due to a feature in Magento called 'section' or 'private data'. It is intricate to debug. I suggest to check...
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