next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Compilation result does not conform to expectation

Open sbfkcel opened this issue 2 years ago • 3 comments

Verify canary release

  • [X] I verified that the issue exists in the latest Next.js canary release

Provide environment information

    Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.1.0: Sun Oct  9 20:15:52 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8112
    Binaries:
      Node: 16.15.0
      npm: 8.5.5
      Yarn: 1.22.15
      pnpm: N/A
    Relevant packages:
      next: 13.0.3
      eslint-config-next: 12.1.5
      react: 18.2.0
      react-dom: 18.2.0

Which example does this report relate to?

What browser are you using? (if relevant)

Chrome 107.0.5304.110

How are you deploying your application? (if relevant)

next start

Describe the Bug

The development mode is normal, but the compiled results run abnormally. Question 1

let str1 = "Hello";
let str2 = " world"
let result = false ? 'wss' : 'https';
result += `://${str1}`;
result += str2;

// ://Hello world
console.log(result);

Question 2

Some styles will be ignored in the build result.

image

Expected Behavior

Question 1

// https://Hello world
console.log(result);

Question 2

image

To Reproduce

let str1 = "Hello";
let str2 = " world"
let result = false ? 'wss' : 'https';
result += `://${str1}`;
result += str2;

console.log(result);

sbfkcel avatar Nov 18 '22 04:11 sbfkcel

Sounds similar to #43042

Created a reproduction: https://github.com/balazsorban44/nextjs-43060

balazsorban44 avatar Nov 18 '22 13:11 balazsorban44

Yes, in next.config Js After adding swcMinify: false it is normal to compile again.

It is uncertain whether the ignored CSS is normal (border and shadow attributes) or whether the class name does not match.

In short, it is the swcMinify problem.

sbfkcel avatar Nov 18 '22 13:11 sbfkcel

I only verified the computation issue, if you have a CSS bug, please add a reproduction for that (a minimal repo)

balazsorban44 avatar Nov 18 '22 13:11 balazsorban44

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

github-actions[bot] avatar Dec 20 '22 12:12 github-actions[bot]