最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Next JS build not working with Apostrophe - Stack Overflow

programmeradmin2浏览0评论

This is running build but,

import styles from '../styles/Home.module.css'
    
    export default function Home() {
      return (
        
        <div className={styles.container}>
          <title>Filmydom</title>
          <h1>Filmydom</h1>
          <tagline>Lets be Filmy</tagline>
          <br />
          <br />
          <h3>Coming Soon</h3>
        </div>
      )
    }

This is not

import styles from '../styles/Home.module.css'
    
    export default function Home() {
      return (
        
        <div className={styles.container}>
          <title>Filmydom</title>
          <h1>Filmydom</h1>
          <tagline>Let's be Filmy</tagline>
          <br />
          <br />
          <h3>Coming Soon</h3>
        </div>
      )
    }

Just because the tagline contains " ' ".

This happened when I was trying to build and deploy on firebase.

How to build with Apostrophe.

This is running build but,

import styles from '../styles/Home.module.css'
    
    export default function Home() {
      return (
        
        <div className={styles.container}>
          <title>Filmydom</title>
          <h1>Filmydom</h1>
          <tagline>Lets be Filmy</tagline>
          <br />
          <br />
          <h3>Coming Soon</h3>
        </div>
      )
    }

This is not

import styles from '../styles/Home.module.css'
    
    export default function Home() {
      return (
        
        <div className={styles.container}>
          <title>Filmydom</title>
          <h1>Filmydom</h1>
          <tagline>Let's be Filmy</tagline>
          <br />
          <br />
          <h3>Coming Soon</h3>
        </div>
      )
    }

Just because the tagline contains " ' ".

This happened when I was trying to build and deploy on firebase.

How to build with Apostrophe.

Share Improve this question asked Aug 29, 2021 at 18:29 user15991162user15991162
Add a ment  | 

4 Answers 4

Reset to default 5

Is tagline a valid HTML Element? I wonder if that could be contributing to this odd behavior.

Otherwise could try string literal:

export default function Home() {
      return (
        
        <div className={styles.container}>
          <title>Filmydom</title>
          <h1>Filmydom</h1>
          <tagline>{`Let's be Filmy`}</tagline>
          <br />
          <br />
          <h3>Coming Soon</h3>
        </div>
      )
    }

You can use &apos; for the Apostrophe to build successfully.

I was able to clear an error like this by replacing the apostrophe with the universal html symbol like the following:

Space ( ) is &#32

Exclamation mark (!) is &#33

Double quotation (“) is &#34

Number sign (#) is &#35

Percent sign (%) is &#37

Comma (,) is &#44

Hyphen (-) is &#45

Period (.) is &#46

Slash (/) is &#47

And of course... Apostrophe (') is &#39

Example
Error prone
<p>Let's connect!</p>

Clean
<p>Let&#39;s connect!</p>

I just updated .eslintrc.json with this following code

"react/no-unescaped-entities": "off"
发布评论

评论列表(0)

  1. 暂无评论