@swc/plugin-styled-jsx 1.5.21 → 1.5.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +5 -9
- package/package.json +1 -1
- package/swc_plugin_styled_jsx.wasm +0 -0
- package/transform/Cargo.toml +6 -8
- package/transform/src/transform_css.rs +61 -207
- package/transform/tests/errors/nested-style-tags/output.stderr +15 -9
- package/transform/tests/errors/no-child/output.stderr +4 -2
- package/transform/tests/errors/two-children/output.stderr +4 -2
- package/transform/tests/errors/wrong-child-type/output.stderr +4 -2
- package/transform/tests/errors/wrong-jsx-expression-type/output.stderr +4 -2
package/Cargo.toml
CHANGED
|
@@ -15,9 +15,8 @@ custom_transform = ["swc_core/common_concurrent"]
|
|
|
15
15
|
|
|
16
16
|
[dependencies]
|
|
17
17
|
easy-error = "1.0.0"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
swc_core = { version = "0.40.56", features = [
|
|
18
|
+
styled_jsx = { version = "0.29.0", path = "./transform" }
|
|
19
|
+
swc_core = { version = "0.44.2", features = [
|
|
21
20
|
"common",
|
|
22
21
|
"ecma_ast",
|
|
23
22
|
"css_ast",
|
|
@@ -30,11 +29,8 @@ swc_core = { version = "0.40.56", features = [
|
|
|
30
29
|
"ecma_utils",
|
|
31
30
|
"ecma_visit",
|
|
32
31
|
] }
|
|
33
|
-
|
|
34
|
-
styled_jsx = {version = "0.29.0", path = "./transform"}
|
|
32
|
+
tracing = { version = "0.1.37", features = ["release_max_level_off"] }
|
|
35
33
|
|
|
36
34
|
[dev-dependencies]
|
|
37
|
-
swc_core = { features = [
|
|
38
|
-
|
|
39
|
-
], version = "0.40.56" }
|
|
40
|
-
testing = "0.31.13"
|
|
35
|
+
swc_core = { features = ["testing_transform"], version = "0.44.2" }
|
|
36
|
+
testing = "0.31.17"
|
package/package.json
CHANGED
|
Binary file
|
package/transform/Cargo.toml
CHANGED
|
@@ -4,16 +4,16 @@ description = "AST transforms visitor for styled-jsx"
|
|
|
4
4
|
edition = "2021"
|
|
5
5
|
license = "Apache-2.0"
|
|
6
6
|
name = "styled_jsx"
|
|
7
|
-
version = "0.29.
|
|
7
|
+
version = "0.29.6"
|
|
8
8
|
|
|
9
9
|
[features]
|
|
10
10
|
custom_transform = ["swc_core/common_concurrent"]
|
|
11
11
|
|
|
12
12
|
[dependencies]
|
|
13
13
|
easy-error = "1.0.0"
|
|
14
|
-
tracing = "0.1.
|
|
14
|
+
tracing = "0.1.37"
|
|
15
15
|
|
|
16
|
-
swc_core = { version = "0.
|
|
16
|
+
swc_core = { version = "0.44.2", features = [
|
|
17
17
|
"common",
|
|
18
18
|
"ecma_ast",
|
|
19
19
|
"css_ast",
|
|
@@ -24,11 +24,9 @@ swc_core = { version = "0.40.56", features = [
|
|
|
24
24
|
"ecma_parser",
|
|
25
25
|
"ecma_minifier",
|
|
26
26
|
"ecma_utils",
|
|
27
|
-
"ecma_visit"
|
|
27
|
+
"ecma_visit",
|
|
28
28
|
] }
|
|
29
29
|
|
|
30
30
|
[dev-dependencies]
|
|
31
|
-
testing = "0.31.
|
|
32
|
-
swc_core = { features = [
|
|
33
|
-
"testing_transform"
|
|
34
|
-
], version = "0.40.56" }
|
|
31
|
+
testing = "0.31.17"
|
|
32
|
+
swc_core = { features = ["testing_transform"], version = "0.44.2" }
|
|
@@ -13,8 +13,12 @@ use swc_core::{
|
|
|
13
13
|
CodeGenerator, CodegenConfig, Emit,
|
|
14
14
|
},
|
|
15
15
|
parser::{
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
lexer::Lexer,
|
|
17
|
+
parse_input,
|
|
18
|
+
parser::{
|
|
19
|
+
input::{InputType, Tokens},
|
|
20
|
+
Parser, ParserConfig,
|
|
21
|
+
},
|
|
18
22
|
},
|
|
19
23
|
prefixer::prefixer,
|
|
20
24
|
visit::{VisitMut, VisitMutWith},
|
|
@@ -39,18 +43,23 @@ pub fn transform_css(
|
|
|
39
43
|
) -> Result<Expr, Error> {
|
|
40
44
|
debug!("CSS: \n{}", style_info.css);
|
|
41
45
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
// TODO use `parse_string_input` in future
|
|
47
|
+
let config = ParserConfig {
|
|
48
|
+
allow_wrong_line_comments: true,
|
|
49
|
+
css_modules: false,
|
|
50
|
+
..Default::default()
|
|
51
|
+
};
|
|
52
|
+
let lexer = Lexer::new(
|
|
53
|
+
StringInput::new(
|
|
54
|
+
&style_info.css,
|
|
55
|
+
style_info.css_span.lo,
|
|
56
|
+
style_info.css_span.hi,
|
|
57
|
+
),
|
|
58
|
+
config,
|
|
53
59
|
);
|
|
60
|
+
let mut parser = Parser::new(lexer, config);
|
|
61
|
+
|
|
62
|
+
let result: Result<Stylesheet, _> = parser.parse_all();
|
|
54
63
|
let mut ss = match result {
|
|
55
64
|
Ok(ss) => ss,
|
|
56
65
|
Err(err) => {
|
|
@@ -170,6 +179,7 @@ impl VisitMut for Namespacer {
|
|
|
170
179
|
|
|
171
180
|
let mut new_selectors = vec![];
|
|
172
181
|
let mut combinator = None;
|
|
182
|
+
|
|
173
183
|
for sel in node.children.take() {
|
|
174
184
|
match &sel {
|
|
175
185
|
ComplexSelectorChildren::CompoundSelector(selector) => {
|
|
@@ -207,90 +217,62 @@ impl Namespacer {
|
|
|
207
217
|
mut node: CompoundSelector,
|
|
208
218
|
) -> Result<Vec<ComplexSelectorChildren>, Error> {
|
|
209
219
|
let mut pseudo_index = None;
|
|
210
|
-
let mut arg_tokens;
|
|
211
220
|
|
|
212
221
|
for (i, selector) in node.subclass_selectors.iter().enumerate() {
|
|
213
|
-
let (name,
|
|
214
|
-
SubclassSelector::PseudoClass(PseudoClassSelector {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
PseudoClassSelectorChildren::Ident(v) => to_tokens(v).tokens,
|
|
225
|
-
PseudoClassSelectorChildren::Str(v) => to_tokens(v).tokens,
|
|
226
|
-
PseudoClassSelectorChildren::Delimiter(v) => to_tokens(v).tokens,
|
|
227
|
-
PseudoClassSelectorChildren::SelectorList(v) => to_tokens(v).tokens,
|
|
228
|
-
PseudoClassSelectorChildren::CompoundSelectorList(v) => {
|
|
229
|
-
to_tokens(v).tokens
|
|
230
|
-
}
|
|
231
|
-
PseudoClassSelectorChildren::RelativeSelectorList(v) => {
|
|
232
|
-
to_tokens(v).tokens
|
|
233
|
-
}
|
|
234
|
-
PseudoClassSelectorChildren::CompoundSelector(v) => to_tokens(v).tokens,
|
|
235
|
-
PseudoClassSelectorChildren::ForgivingSelectorList(v) => {
|
|
236
|
-
to_tokens(v).tokens
|
|
237
|
-
}
|
|
238
|
-
PseudoClassSelectorChildren::ForgivingRelativeSelectorList(v) => {
|
|
239
|
-
to_tokens(v).tokens
|
|
240
|
-
}
|
|
241
|
-
PseudoClassSelectorChildren::ComplexSelector(v) => to_tokens(v).tokens,
|
|
242
|
-
})
|
|
243
|
-
.collect::<Vec<_>>();
|
|
244
|
-
|
|
245
|
-
(name, &arg_tokens)
|
|
246
|
-
}
|
|
247
|
-
SubclassSelector::PseudoElement(PseudoElementSelector {
|
|
248
|
-
name, children, ..
|
|
249
|
-
}) => {
|
|
250
|
-
arg_tokens = children
|
|
251
|
-
.iter()
|
|
252
|
-
.flatten()
|
|
253
|
-
.flat_map(|v| match v {
|
|
254
|
-
PseudoElementSelectorChildren::PreservedToken(v) => vec![v.clone()],
|
|
255
|
-
PseudoElementSelectorChildren::Ident(v) => to_tokens(v).tokens,
|
|
256
|
-
PseudoElementSelectorChildren::CompoundSelector(v) => {
|
|
257
|
-
to_tokens(v).tokens
|
|
258
|
-
}
|
|
259
|
-
PseudoElementSelectorChildren::CustomHighlightName(v) => {
|
|
260
|
-
to_tokens(v).tokens
|
|
261
|
-
}
|
|
262
|
-
})
|
|
263
|
-
.collect::<Vec<_>>();
|
|
222
|
+
let (name, children) = match &selector {
|
|
223
|
+
SubclassSelector::PseudoClass(PseudoClassSelector {
|
|
224
|
+
name,
|
|
225
|
+
children: Some(children),
|
|
226
|
+
..
|
|
227
|
+
}) if &name.value == "global" => (name, children),
|
|
228
|
+
SubclassSelector::PseudoClass(_) | SubclassSelector::PseudoElement(_) => {
|
|
229
|
+
if pseudo_index.is_none() {
|
|
230
|
+
pseudo_index = Some(i);
|
|
231
|
+
}
|
|
264
232
|
|
|
265
|
-
|
|
233
|
+
continue;
|
|
266
234
|
}
|
|
267
235
|
_ => continue,
|
|
268
236
|
};
|
|
269
237
|
|
|
270
238
|
// One off global selector
|
|
271
239
|
if &name.value == "global" {
|
|
272
|
-
|
|
273
|
-
let
|
|
274
|
-
|
|
275
|
-
|
|
240
|
+
// TODO(alexander-akait): in future we should use list of component values
|
|
241
|
+
let tokens = children
|
|
242
|
+
.iter()
|
|
243
|
+
.map(|v| match v {
|
|
244
|
+
PseudoClassSelectorChildren::PreservedToken(v) => v.clone(),
|
|
245
|
+
_ => {
|
|
246
|
+
unreachable!();
|
|
247
|
+
}
|
|
248
|
+
})
|
|
249
|
+
.collect::<Vec<TokenAndSpan>>();
|
|
250
|
+
let mut tokens = {
|
|
251
|
+
let lo = tokens.first().map(|v| v.span_lo()).unwrap_or(BytePos(0));
|
|
252
|
+
let hi = tokens.last().map(|v| v.span_hi()).unwrap_or(BytePos(0));
|
|
276
253
|
|
|
277
254
|
Tokens {
|
|
278
255
|
span: Span::new(lo, hi, Default::default()),
|
|
279
|
-
tokens
|
|
256
|
+
tokens,
|
|
280
257
|
}
|
|
281
258
|
};
|
|
282
259
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
260
|
+
// Because it is allowed to write `.bar :global(> .foo) {}` or .bar
|
|
261
|
+
// :global(.foo) {}`, so selector can be complex or relative (it violates the
|
|
262
|
+
// specification), but it is popular usage, so we just add `a >` at top and then
|
|
263
|
+
// remove it
|
|
264
|
+
let mut front_tokens = get_front_selector_tokens(&tokens);
|
|
265
|
+
|
|
266
|
+
front_tokens.extend(tokens.tokens);
|
|
267
|
+
|
|
268
|
+
tokens.tokens = front_tokens;
|
|
288
269
|
|
|
289
270
|
let complex_selectors = panic::catch_unwind(|| {
|
|
290
|
-
let x: ComplexSelector =
|
|
291
|
-
&
|
|
271
|
+
let x: ComplexSelector = parse_input(
|
|
272
|
+
InputType::Tokens(&tokens),
|
|
292
273
|
ParserConfig {
|
|
293
274
|
allow_wrong_line_comments: true,
|
|
275
|
+
css_modules: true,
|
|
294
276
|
..Default::default()
|
|
295
277
|
},
|
|
296
278
|
// TODO(kdy1): We might be able to report syntax errors.
|
|
@@ -348,8 +330,6 @@ impl Namespacer {
|
|
|
348
330
|
}
|
|
349
331
|
Err(_) => bail!("Failed to transform one off global selector"),
|
|
350
332
|
};
|
|
351
|
-
} else if pseudo_index.is_none() {
|
|
352
|
-
pseudo_index = Some(i);
|
|
353
333
|
}
|
|
354
334
|
}
|
|
355
335
|
|
|
@@ -361,6 +341,7 @@ impl Namespacer {
|
|
|
361
341
|
None => node.subclass_selectors.len(),
|
|
362
342
|
Some(i) => i,
|
|
363
343
|
};
|
|
344
|
+
|
|
364
345
|
if !self.is_global {
|
|
365
346
|
node.subclass_selectors.insert(
|
|
366
347
|
insert_index,
|
|
@@ -411,130 +392,3 @@ fn get_front_selector_tokens(selector_tokens: &Tokens) -> Vec<TokenAndSpan> {
|
|
|
411
392
|
},
|
|
412
393
|
]
|
|
413
394
|
}
|
|
414
|
-
|
|
415
|
-
fn get_block_tokens(selector_tokens: &Tokens) -> Vec<TokenAndSpan> {
|
|
416
|
-
let start_pos = selector_tokens.span.hi.to_u32();
|
|
417
|
-
vec![
|
|
418
|
-
TokenAndSpan {
|
|
419
|
-
span: Span {
|
|
420
|
-
lo: BytePos(start_pos),
|
|
421
|
-
hi: BytePos(start_pos + 1),
|
|
422
|
-
ctxt: SyntaxContext::empty(),
|
|
423
|
-
},
|
|
424
|
-
token: Token::WhiteSpace { value: " ".into() },
|
|
425
|
-
},
|
|
426
|
-
TokenAndSpan {
|
|
427
|
-
span: Span {
|
|
428
|
-
lo: BytePos(start_pos + 1),
|
|
429
|
-
hi: BytePos(start_pos + 2),
|
|
430
|
-
ctxt: SyntaxContext::empty(),
|
|
431
|
-
},
|
|
432
|
-
token: Token::LBrace,
|
|
433
|
-
},
|
|
434
|
-
TokenAndSpan {
|
|
435
|
-
span: Span {
|
|
436
|
-
lo: BytePos(start_pos + 2),
|
|
437
|
-
hi: BytePos(start_pos + 3),
|
|
438
|
-
ctxt: SyntaxContext::empty(),
|
|
439
|
-
},
|
|
440
|
-
token: Token::WhiteSpace { value: " ".into() },
|
|
441
|
-
},
|
|
442
|
-
TokenAndSpan {
|
|
443
|
-
span: Span {
|
|
444
|
-
lo: BytePos(start_pos + 3),
|
|
445
|
-
hi: BytePos(start_pos + 8),
|
|
446
|
-
ctxt: SyntaxContext::empty(),
|
|
447
|
-
},
|
|
448
|
-
token: Token::Ident {
|
|
449
|
-
value: "color".into(),
|
|
450
|
-
raw: "color".into(),
|
|
451
|
-
},
|
|
452
|
-
},
|
|
453
|
-
TokenAndSpan {
|
|
454
|
-
span: Span {
|
|
455
|
-
lo: BytePos(start_pos + 8),
|
|
456
|
-
hi: BytePos(start_pos + 9),
|
|
457
|
-
ctxt: SyntaxContext::empty(),
|
|
458
|
-
},
|
|
459
|
-
token: Token::Colon,
|
|
460
|
-
},
|
|
461
|
-
TokenAndSpan {
|
|
462
|
-
span: Span {
|
|
463
|
-
lo: BytePos(start_pos + 9),
|
|
464
|
-
hi: BytePos(start_pos + 10),
|
|
465
|
-
ctxt: SyntaxContext::empty(),
|
|
466
|
-
},
|
|
467
|
-
token: Token::WhiteSpace { value: " ".into() },
|
|
468
|
-
},
|
|
469
|
-
TokenAndSpan {
|
|
470
|
-
span: Span {
|
|
471
|
-
lo: BytePos(start_pos + 10),
|
|
472
|
-
hi: BytePos(start_pos + 13),
|
|
473
|
-
ctxt: SyntaxContext::empty(),
|
|
474
|
-
},
|
|
475
|
-
token: Token::Ident {
|
|
476
|
-
value: "red".into(),
|
|
477
|
-
raw: "red".into(),
|
|
478
|
-
},
|
|
479
|
-
},
|
|
480
|
-
TokenAndSpan {
|
|
481
|
-
span: Span {
|
|
482
|
-
lo: BytePos(start_pos + 13),
|
|
483
|
-
hi: BytePos(start_pos + 14),
|
|
484
|
-
ctxt: SyntaxContext::empty(),
|
|
485
|
-
},
|
|
486
|
-
token: Token::Semi,
|
|
487
|
-
},
|
|
488
|
-
TokenAndSpan {
|
|
489
|
-
span: Span {
|
|
490
|
-
lo: BytePos(start_pos + 14),
|
|
491
|
-
hi: BytePos(start_pos + 15),
|
|
492
|
-
ctxt: SyntaxContext::empty(),
|
|
493
|
-
},
|
|
494
|
-
token: Token::WhiteSpace { value: " ".into() },
|
|
495
|
-
},
|
|
496
|
-
TokenAndSpan {
|
|
497
|
-
span: Span {
|
|
498
|
-
lo: BytePos(start_pos + 15),
|
|
499
|
-
hi: BytePos(start_pos + 16),
|
|
500
|
-
ctxt: SyntaxContext::empty(),
|
|
501
|
-
},
|
|
502
|
-
token: Token::RBrace,
|
|
503
|
-
},
|
|
504
|
-
TokenAndSpan {
|
|
505
|
-
span: Span {
|
|
506
|
-
lo: BytePos(start_pos + 16),
|
|
507
|
-
hi: BytePos(start_pos + 17),
|
|
508
|
-
ctxt: SyntaxContext::empty(),
|
|
509
|
-
},
|
|
510
|
-
token: Token::WhiteSpace { value: " ".into() },
|
|
511
|
-
},
|
|
512
|
-
]
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
fn to_tokens<N: Spanned>(node: &N) -> Tokens
|
|
516
|
-
where
|
|
517
|
-
for<'aa> CodeGenerator<&'aa mut BasicCssWriter<'aa, &'aa mut std::string::String>>: Emit<N>,
|
|
518
|
-
{
|
|
519
|
-
let mut s = String::new();
|
|
520
|
-
{
|
|
521
|
-
let mut wr = BasicCssWriter::new(&mut s, None, BasicCssWriterConfig::default());
|
|
522
|
-
let mut gen = CodeGenerator::new(&mut wr, CodegenConfig { minify: true });
|
|
523
|
-
|
|
524
|
-
gen.emit(node).unwrap();
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
let span = node.span();
|
|
528
|
-
let lexer = swc_core::css::parser::lexer::Lexer::new(
|
|
529
|
-
StringInput::new(&s, span.lo, span.hi),
|
|
530
|
-
ParserConfig {
|
|
531
|
-
allow_wrong_line_comments: true,
|
|
532
|
-
..Default::default()
|
|
533
|
-
},
|
|
534
|
-
);
|
|
535
|
-
|
|
536
|
-
Tokens {
|
|
537
|
-
span: Span::new(span.lo, span.hi, Default::default()),
|
|
538
|
-
tokens: lexer.collect(),
|
|
539
|
-
}
|
|
540
|
-
}
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
|
|
2
2
|
x Detected nested styled-jsx tag.
|
|
3
3
|
| Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
|
|
4
|
-
,-[input.js:
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
,-[input.js:12:1]
|
|
5
|
+
12 | Welcome!
|
|
6
|
+
13 | <style jsx>{``}</style>
|
|
7
|
+
: ^^^^^^^^^^^^^^^^^^^^^^^
|
|
8
|
+
14 | </h1>
|
|
7
9
|
`----
|
|
8
10
|
|
|
9
11
|
x Detected nested styled-jsx tag.
|
|
10
12
|
| Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
|
|
11
|
-
,-[input.js:
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
,-[input.js:20:1]
|
|
14
|
+
20 | Hello world!
|
|
15
|
+
21 | <style jsx global>{``}</style>
|
|
16
|
+
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
17
|
+
22 | </h1>
|
|
14
18
|
`----
|
|
15
19
|
|
|
16
20
|
x Detected nested styled-jsx tag.
|
|
17
21
|
| Read more: https://nextjs.org/docs/messages/nested-styled-jsx-tags
|
|
18
|
-
,-[input.js:
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
,-[input.js:25:1]
|
|
23
|
+
25 | <>
|
|
24
|
+
26 | <style jsx>{styles}</style>
|
|
25
|
+
: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
26
|
+
27 | </>
|
|
21
27
|
`----
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
x Expected one child under JSX style tag, but got 0.
|
|
3
3
|
| Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
|
|
4
|
-
,-[input.js:
|
|
5
|
-
|
|
4
|
+
,-[input.js:2:1]
|
|
5
|
+
2 | <div>
|
|
6
|
+
3 | ,-> <style jsx>
|
|
6
7
|
4 | `-> </style>
|
|
8
|
+
5 | </div>
|
|
7
9
|
`----
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
x Expected one child under JSX style tag, but got 2.
|
|
3
3
|
| Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
|
|
4
|
-
,-[input.js:
|
|
5
|
-
|
|
4
|
+
,-[input.js:2:1]
|
|
5
|
+
2 | <div>
|
|
6
|
+
3 | ,-> <style jsx>
|
|
6
7
|
4 | | {`.p {}`}
|
|
7
8
|
5 | | {`.p {}`}
|
|
8
9
|
6 | `-> </style>
|
|
10
|
+
7 | </div>
|
|
9
11
|
`----
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
x Expected a single child of type JSXExpressionContainer under JSX Style tag.
|
|
3
3
|
| Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
|
|
4
|
-
,-[input.js:
|
|
5
|
-
|
|
4
|
+
,-[input.js:2:1]
|
|
5
|
+
2 | <div>
|
|
6
|
+
3 | ,-> <style jsx>
|
|
6
7
|
4 | | 10
|
|
7
8
|
5 | `-> </style>
|
|
9
|
+
6 | </div>
|
|
8
10
|
`----
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
x Expected a template literal, string or identifier inside the JSXExpressionContainer.
|
|
3
3
|
| Read more: https://nextjs.org/docs/messages/invalid-styled-jsx-children
|
|
4
|
-
,-[input.js:
|
|
5
|
-
|
|
4
|
+
,-[input.js:2:1]
|
|
5
|
+
2 | <div>
|
|
6
|
+
3 | ,-> <style jsx>
|
|
6
7
|
4 | | {[]}
|
|
7
8
|
5 | `-> </style>
|
|
9
|
+
6 | </div>
|
|
8
10
|
`----
|