postcss-rtl icon indicating copy to clipboard operation
postcss-rtl copied to clipboard

TypeError: Cannot set property 'parent' of undefined

Open ranisalt opened this issue 4 years ago • 3 comments

This issue is happening always.

./src/css/main.css (/path/to/node_modules/css-loader/dist/cjs.js??ref--6-1!/path/to/node_modules/postcss-loader/src??postcss!./src/css/main.css)
Module build failed (from /path/to/node_modules/postcss-loader/src/index.js):
TypeError: Cannot set property 'parent' of undefined
    at /path/to/src/css/components/sidebar.css:1:1
    at Rule.removeChild (/path/to/node_modules/postcss-import/node_modules/postcss/lib/container.js:584:30)
    at /path/to/node_modules/postcss-rtl/lib/index.js:186:14
    at Array.forEach (<anonymous>)
    at /path/to/node_modules/postcss-rtl/lib/index.js:183:16
    at /path/to/node_modules/postcss-loader/node_modules/postcss/lib/container.js:135:18
    at Root.each (/path/to/node_modules/postcss-loader/node_modules/postcss/lib/container.js:101:16)
    at Root.walk (/path/to/node_modules/postcss-loader/node_modules/postcss/lib/container.js:131:17)
    at /path/to/node_modules/postcss-rtl/lib/index.js:147:7
    at LazyResult.run (/path/to/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:295:14)
    at LazyResult.asyncTick (/path/to/node_modules/postcss-loader/node_modules/postcss/lib/lazy-result.js:208:26)

My webpack config with postcss support is:

module.exports = {
 module: {
  rules: [
   {
    test: /\.css$/,
    use: [
     'style-loader',
     { loader: 'css-loader', options: { importLoaders: 1 } },
     {
      loader: 'postcss-loader',
      options: {
       ident: 'postcss',
       plugins: [
        require('postcss-import'),
        require('precss'),
        require('postcss-rtl'),
        require('tailwindcss'),
        require('autoprefixer'),
       ],
      },
     },
    ],
   },
  ],
 },
}

formwrapper.css is:

.forgot-password {
	@apply m-5 w-full px-16 py-6;
	max-width: 48rem;

	@screen mobile {
		@apply px-3 py-6;
	}

	.controls {
		@apply my-5 text-xs leading-snug;
	}

	.label {
		@screen tablet {
			& + .input {
				@apply mt-3;
			}
		}

		@screen mobile {
			@apply hidden;
		}
	}
}

ranisalt avatar Feb 04 '20 04:02 ranisalt

@ranisalt cannot reproduce. Can you share a minimal reproducible example?

vkalinichev avatar Feb 18 '20 19:02 vkalinichev

@vkalinichev we also having this issue, it is planned to be addressed ?

yuvalyacoby avatar Nov 05 '20 09:11 yuvalyacoby

I think it's because of nested css .

rraammiinn avatar Oct 29 '23 14:10 rraammiinn