locatorjs icon indicating copy to clipboard operation
locatorjs copied to clipboard

bug: windows os , vite react can't working

Open tomatobybike opened this issue 6 months ago • 1 comments

Where the bug happens

  • [ ] Browser Extension
  • [ ] Library
  • [X] Other

your browser

chrome

Describe the bug

yarn run start throw this: vite Error: offset is longer than source length! offset 214 > length 112

but on mac os , everything is ok


windows os ,when i delete this code in vite.config.js

        [
          '@locator/babel-jsx/dist',
          {
            env: 'development'
          }
        ]

the web can work

tomatobybike avatar Dec 06 '23 11:12 tomatobybike

So, i change the vite config like this:

if (process.platform !== 'win32') {
  babelPlugins.push([
    '@locator/babel-jsx/dist',
    {
      env: 'development'
    }
  ])
}

react({
    babel: {
      plugins: babelPlugins
    }
  })

if the platform is win32 ,remove this plugin

tomatobybike avatar Dec 06 '23 12:12 tomatobybike