Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid CSS breaks survey-core with NextJS 15 #6040

Open
iotashan opened this issue Nov 5, 2024 · 5 comments
Open

Invalid CSS breaks survey-core with NextJS 15 #6040

iotashan opened this issue Nov 5, 2024 · 5 comments
Assignees
Labels
need more info user issue An issue or bug reported by users.

Comments

@iotashan
Copy link

iotashan commented Nov 5, 2024

::i-block-chrome is not valid CSS, and breaks if you try to use survey-creator-react with Next.js 15

import 'survey-creator-core/survey-creator-core.min.css';

Unsupported pseudo class or element: i-block-chrome

@JaneSjs JaneSjs added bug user issue An issue or bug reported by users. labels Nov 7, 2024
@tsv2013
Copy link
Member

tsv2013 commented Nov 8, 2024

This was done to fix the surveyjs/survey-library#5507 issue
And reserve place for scroll bar in safari - e28ef3c

@tsv2013
Copy link
Member

tsv2013 commented Nov 8, 2024

@iotashan Probably you can setup to skip this rule check for this code, or for the whole survey-creator-core.min.css file

@JaneSjs JaneSjs self-assigned this Nov 8, 2024
@JaneSjs
Copy link
Contributor

JaneSjs commented Nov 8, 2024

Hello @iotashan,
I created a fresh NextJS 15 application (v15.0.3). Please download it at
next-15.zip. I successfully ran the npm run dev and npm run build commands and didn't get the mentioned error.
Please try the demo on your end and clarify how to reproduce the issue.

Thanks

@JaneSjs JaneSjs closed this as completed Nov 14, 2024
@JaneSjs JaneSjs reopened this Nov 14, 2024
@JaneSjs JaneSjs removed the bug label Nov 14, 2024
@JaneSjs JaneSjs removed their assignment Nov 14, 2024
@ojkaas
Copy link

ojkaas commented Nov 19, 2024

I also get the same error, tried the demo project and that works, set the package version to the same versions in my project, but then I get the same error. Will try to see if I can create something reproducible but the current project I cannot easily share. Any tips in the meantime how I could skip this check?

@JaneSjs JaneSjs self-assigned this Nov 19, 2024
@JaneSjs
Copy link
Contributor

JaneSjs commented Nov 19, 2024

Hello Everyone,
@ojkaas, thank you for contacting us. I would appreciate it if you could recreate this issue on a sample demo and share it for research. In the meantime, you can try to suppress this warning using the following options.

In Next.js, you can configure PostCSS to ignore non-standard CSS rules. Add or modify your postcss.config.js as follows:

module.exports = {
  plugins: {
    'postcss-custom-properties': {}, // Include other plugins as needed
    'postcss-preset-env': {
      stage: 0,
      features: {
        'custom-selectors': false, // Disable optimizations for non-standard selectors
      },
    },
  },
};

Alternatively, modify your Webpack configuration in next.config.js to suppress CSS warnings related to ::i-block-chrome.

module.exports = {
  webpack: (config) => {
    config.module.rules.push({
      test: /\.css$/,
      use: [
        {
          loader: 'css-loader',
          options: {
            warn: false, // Suppress CSS warnings
          },
        },
      ],
    });
    return config;
  },
};

I hope that either option can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info user issue An issue or bug reported by users.
Projects
None yet
Development

No branches or pull requests

4 participants