Cannot read properties of null (reading 'scrollTop')

I successfully deployed my website to Netlify, but I’ve encountered an issue with the button function on the first page. It seems to be working fine on localhost and the production website, but on Netlify, it’s not functioning properly and throwing an error.

I’m wondering if there’s any setting I might have missed during the deployment to Netlify. I’m a bit hesitant about transitioning from Heroku to Netlify because of the current issues I’m facing, and I’m concerned that additional issues might arise.

• Website on Netlify: https://stonewell.netlify.app/
• Production website in Heroku: https://www.stonewellfinancial.com/

Error: Uncaught TypeError: Cannot read properties of null (reading ‘scrollTop’)
at floatbutton1_c129acce0004cf020d779f7822c043b0_.js:1:115
at floatbutton1_c129acce0004cf020d779f7822c043b0_.js:1:19820

Recent build log:
4:09:27 PM: Netlify Build
4:09:27 PM: ────────────────────────────────────────────────────────────────
4:09:27 PM: ​
4:09:27 PM: ❯ Version
4:09:27 PM: @netlify/build 29.11.6
4:09:27 PM: ​
4:09:27 PM: ❯ Flags
4:09:27 PM: baseRelDir: true
4:09:27 PM: buildId: 647657cf6b58040c8e3b160d
4:09:27 PM: deployId: 647657cf6b58040c8e3b160f
4:09:27 PM: ​
4:09:27 PM: ❯ Current directory
4:09:27 PM: /opt/build/repo/client
4:09:27 PM: ​
4:09:27 PM: ❯ Config file
4:09:27 PM: /opt/build/repo/netlify.toml
4:09:27 PM: ​
4:09:27 PM: ❯ Context
4:09:27 PM: production
4:09:27 PM: ​
4:09:27 PM: build.command from netlify.toml
4:09:27 PM: ────────────────────────────────────────────────────────────────
4:09:27 PM: ​
4:09:27 PM: $ npm run build
4:09:27 PM: > client@0.1.0 build /opt/build/repo/client
4:09:27 PM: > react-scripts build
4:09:28 PM: Creating an optimized production build…
4:09:29 PM: Browserslist: caniuse-lite is outdated. Please run:
4:09:29 PM: npx browserslist@latest --update-db
4:09:29 PM: Why you should do it regularly: GitHub - browserslist/browserslist: 🦔 Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-preset-env
4:10:21 PM: Compiled successfully.
4:10:21 PM:
4:10:21 PM: File sizes after gzip:
4:10:21 PM: 909.69 KB build/static/js/main.9de56f40.chunk.js
4:10:21 PM: 573.64 KB build/static/js/2.8da40ebb.chunk.js
4:10:21 PM: 5.44 KB build/static/css/2.6caa8e7f.chunk.css
4:10:21 PM: 1.22 KB build/static/css/main.c571d416.chunk.css
4:10:21 PM: 772 B build/static/js/runtime-main.a9f80a17.js
4:10:21 PM: The bundle size is significantly larger than recommended.
4:10:21 PM: Consider reducing it with code splitting: https://goo.gl/9VhYWB
4:10:21 PM: You can also analyze the project dependencies: https://goo.gl/LeUzfb
4:10:21 PM: The project was built assuming it is hosted at /.
4:10:21 PM: You can control this with the homepage field in your package.json.
4:10:21 PM: The build folder is ready to be deployed.
4:10:21 PM: You may serve it with a static server:
4:10:21 PM: yarn global add serve
4:10:21 PM: serve -s build
4:10:21 PM: Find out more about deployment here:
4:10:21 PM: Deployment | Create React App
4:10:22 PM: > client@0.1.0 postbuild /opt/build/repo/client
4:10:22 PM: > react-hydratable
4:10:22 PM: react-hydratable: Config build…
4:10:22 PM: react-hydratable: Config is here
4:10:22 PM: {
4:10:22 PM: webroot: ‘/opt/build/repo/client/build’,
4:10:22 PM: host: ‘http://localhost’,
4:10:22 PM: port: 3000,
4:10:22 PM: crawlingUrls: [
4:10:22 PM: ‘/’,
4:10:22 PM: ‘/ko’,
4:10:22 PM: ‘/ar’,
4:10:22 PM: ‘/ch_s’,
4:10:22 PM: ‘/ch_t’,
4:10:22 PM: ‘/de’,
4:10:22 PM: ‘/es’,
4:10:22 PM: ‘/fa’,
4:10:22 PM: ‘/fr’,
4:10:22 PM: ‘/ja’,
4:10:22 PM: ‘/pt_br’,
4:10:22 PM: ‘/yue’,
4:10:22 PM: ‘/travel-insurance’,
4:10:22 PM: ‘/travel-insurance/ko’,
4:10:22 PM: ‘/travel-insurance/ar’,
4:10:22 PM: ‘/travel-insurance/ch_s’,
4:10:22 PM: ‘/travel-insurance/ch_t’,
4:10:22 PM: ‘/travel-insurance/de’,
4:10:22 PM: ‘/travel-insurance/es’,
4:10:22 PM: ‘/travel-insurance/fa’,
4:10:22 PM: ‘/travel-insurance/fr’,
4:10:22 PM: ‘/travel-insurance/ja’,
4:10:22 PM: ‘/travel-insurance/pt_br’,
4:10:22 PM: ‘/travel-insurance/yue’,
4:10:22 PM: ‘/travel-insurance/student’,
4:10:22 PM: ‘/travel-insurance/student/ko’,
4:10:22 PM: ‘/travel-insurance/student/ar’,
4:10:22 PM: ‘/travel-insurance/student/ch_s’,
4:10:22 PM: ‘/travel-insurance/student/ch_t’,
4:10:22 PM: ‘/travel-insurance/student/de’,
4:10:22 PM: ‘/travel-insurance/student/es’,
4:10:22 PM: ‘/travel-insurance/student/fa’,
4:10:22 PM: ‘/travel-insurance/student/fr’,
4:10:22 PM: ‘/travel-insurance/student/ja’,
4:10:22 PM: ‘/travel-insurance/student/pt_br’,
4:10:22 PM: ‘/travel-insurance/student/yue’,
4:10:22 PM: ‘/travel-insurance/visitor’,
4:10:22 PM: ‘/travel-insurance/visitor/ko’,
4:10:22 PM: ‘/travel-insurance/visitor/ar’,
4:10:22 PM: ‘/travel-insurance/visitor/ch_s’,
4:10:22 PM: ‘/travel-insurance/visitor/ch_t’,
4:10:22 PM: ‘/travel-insurance/visitor/de’,
4:10:22 PM: ‘/travel-insurance/visitor/es’,
4:10:22 PM: ‘/travel-insurance/visitor/fa’,
4:10:22 PM: ‘/travel-insurance/visitor/fr’,
4:10:22 PM: ‘/travel-insurance/visitor/ja’,
4:10:22 PM: ‘/travel-insurance/visitor/pt_br’,
4:10:22 PM: ‘/travel-insurance/student/yue’
4:10:22 PM: ],
4:10:22 PM: delay: 1500,
4:10:22 PM: userAgent: ‘react-hydratable’,
4:10:22 PM: htmlPrefix: ‘’
4:10:22 PM: }
4:10:22 PM: createHttpServer: server is started
4:10:22 PM: createHttpServer: ready (PORT 3000)
4:10:22 PM: Crawling: start

4:12:01 PM: Crawling: end
4:12:01 PM: createHttpServer: server is closed
4:12:01 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/yue
4:12:01 PM: ​
4:12:01 PM: (build.command completed in 2m 34s)
4:12:01 PM: ​
4:12:02 PM: (Netlify Build completed in 2m 34.9s)
4:12:07 PM: Section completed: building
4:12:15 PM: Finished processing build request in 3m25.667s

Hi @stonewell,

Thanks for reaching out and welcome to Netlify’s Support Forums!

I’m not seeing an error in the deploy log, but I do see the error in the console on the browser:

You’ll want to find the line of code, then check if the variable is null or undefined (verify that the variable trying to be accessed (scrollTop ) has a valid value and is not null or undefined.).

Let us know if you have any questions.

Hi.

We are currently encountering an error in a specific code segment that originates from a third-party service. Unfortunately, as the code belongs to the third-party service, we do not have the ability to modify it directly.

The interesting aspect is that our current website hosted on Heroku is running smoothly without experiencing this error. This leads us to question if there might be any issues specific to our Netlify deployment that could be causing this discrepancy.

We have carefully reviewed our Netlify setup and configurations, including environment variables, build settings, and other relevant factors that might impact the execution of the third-party code. However, we have been unable to identify any obvious issues.

Considering these circumstances, we wanted to reach out to you for any insights or suggestions you might have regarding this situation. We value your expertise and would greatly appreciate any assistance in identifying if there are any potential issues on the Netlify platform that could be contributing to this error.

Thank you in advance for your time and support. We look forward to your response and any recommendations you can provide.

Best Regards,

61BD140731F14ADC92702A9CC4D8F4CD[286536791].png

ED840584ACBA4AB4B6E5DEC585664752[286536792].png

B6AFD6C9F23F4018B0C0F5CC1A45ABF8[286536793].png

0C2F2CEFE35D4BAD80EB3907EF1480E7[286536794].png

579B4305A78D4F208AB3F80650BB6B43[286536795].png

Hi @stonewell,

Thank you for the follow-up.

I looked over your issue with some of the Support team, and we believe the issue with stonewell.netlify.app is the placement of the <script> tag. We believe that the script is erroring because it’s running before the site is fully loaded. When looking at the www.stonewellfinancial.com site, we’re not seeing the same behavior as the site is loading before the script runs.

Could you move the <script> tag so that it is inside the closing </body> tag near the end and see if you have the same issue?

Hello. Despite moving the specific code to right before the </body> tag, the issue persists. Additionally, I’m experiencing difficulties connecting to the Postgre database. I noticed an error related to the database in the browser console. I’m unsure if these two issues are related.

I have correctly set up the environment variables for sure. Strangely, when running the application on localhost, there are no issues encountered.

I have identified the index.html file located under the client/build folder. Upon inspection, I noticed that the problematic <script> tag was originally placed inside the <head> section. To address this issue, I moved the <script> tag to the end of the <body> section.

My recent build log here:
4:52:37 PM: Netlify Build
4:52:37 PM: ────────────────────────────────────────────────────────────────
4:52:37 PM: ​
4:52:37 PM: ❯ Version
4:52:37 PM: @netlify/build 29.12.1
4:52:37 PM: ​
4:52:37 PM: ❯ Flags
4:52:37 PM: baseRelDir: true
4:52:37 PM: buildId: 648ccb78661b2e000966585b
4:52:37 PM: deployId: 648ccb78661b2e000966585d
4:52:37 PM: ​
4:52:37 PM: ❯ Current directory
4:52:37 PM: /opt/build/repo/client
4:52:37 PM: ​
4:52:37 PM: ❯ Config file
4:52:37 PM: /opt/build/repo/netlify.toml
4:52:37 PM: ​
4:52:37 PM: ❯ Context
4:52:37 PM: production
4:52:37 PM: ​
4:52:37 PM: build.command from netlify.toml
4:52:37 PM: ────────────────────────────────────────────────────────────────
4:52:37 PM: ​
4:52:37 PM: $ npm run build
4:52:37 PM: > client@0.1.0 build /opt/build/repo/client
4:52:37 PM: > react-scripts build
4:52:39 PM: Creating an optimized production build…
4:53:26 PM: Compiled successfully.
4:53:26 PM:
4:53:26 PM: File sizes after gzip:
4:53:27 PM: 976.48 KB build/static/js/main.b46ec5b1.chunk.js
4:53:27 PM: 576.54 KB build/static/js/2.712f3608.chunk.js
4:53:27 PM: 5.44 KB build/static/css/2.6caa8e7f.chunk.css
4:53:27 PM: 1.2 KB build/static/css/main.7a86f05e.chunk.css
4:53:27 PM: 772 B build/static/js/runtime-main.a9f80a17.js
4:53:27 PM: The bundle size is significantly larger than recommended.
4:53:27 PM: Consider reducing it with code splitting: create-react-app/packages/react-scripts/template/README.md at main · facebook/create-react-app · GitHub
4:53:27 PM: You can also analyze the project dependencies: create-react-app/packages/react-scripts/template/README.md at main · facebook/create-react-app · GitHub
4:53:27 PM: The project was built assuming it is hosted at /.
4:53:27 PM: You can control this with the homepage field in your package.json.
4:53:27 PM: The build folder is ready to be deployed.
4:53:27 PM: You may serve it with a static server:
4:53:27 PM: npm install -g serve
4:53:27 PM: serve -s build
4:53:27 PM: Find out more about deployment here:
4:53:27 PM: Deployment | Create React App
4:53:27 PM: > client@0.1.0 postbuild /opt/build/repo/client
4:53:27 PM: > react-hydratable
4:53:27 PM: react-hydratable: Config build…
4:53:27 PM: react-hydratable: Config is here
4:53:27 PM: {
4:53:27 PM: webroot: ‘/opt/build/repo/client/build’,
4:53:27 PM: host: ‘http://localhost’,
4:53:27 PM: port: 3000,
4:53:27 PM: crawlingUrls: [
4:53:27 PM: ‘/’,
4:53:27 PM: ‘/ko’,
4:53:27 PM: ‘/ar’,
4:53:27 PM: ‘/ch_s’,
4:53:27 PM: ‘/ch_t’,
4:53:27 PM: ‘/de’,
4:53:27 PM: ‘/es’,
4:53:27 PM: ‘/fa’,
4:53:27 PM: ‘/fr’,
4:53:27 PM: ‘/ja’,
4:53:27 PM: ‘/pt_br’,
4:53:27 PM: ‘/yue’,
4:53:27 PM: ‘/travel-insurance’,
4:53:27 PM: ‘/travel-insurance/ko’,
4:53:27 PM: ‘/travel-insurance/ar’,
4:53:27 PM: ‘/travel-insurance/ch_s’,
4:53:27 PM: ‘/travel-insurance/ch_t’,
4:53:27 PM: ‘/travel-insurance/de’,
4:53:27 PM: ‘/travel-insurance/es’,
4:53:27 PM: ‘/travel-insurance/fa’,
4:53:27 PM: ‘/travel-insurance/fr’,
4:53:27 PM: ‘/travel-insurance/ja’,
4:53:27 PM: ‘/travel-insurance/pt_br’,
4:53:27 PM: ‘/travel-insurance/yue’,
4:53:27 PM: ‘/travel-insurance/student’,
4:53:27 PM: ‘/travel-insurance/student/ko’,
4:53:27 PM: ‘/travel-insurance/student/ar’,
4:53:27 PM: ‘/travel-insurance/student/ch_s’,
4:53:27 PM: ‘/travel-insurance/student/ch_t’,
4:53:27 PM: ‘/travel-insurance/student/de’,
4:53:27 PM: ‘/travel-insurance/student/es’,
4:53:27 PM: ‘/travel-insurance/student/fa’,
4:53:27 PM: ‘/travel-insurance/student/fr’,
4:53:27 PM: ‘/travel-insurance/student/ja’,
4:53:27 PM: ‘/travel-insurance/student/pt_br’,
4:53:27 PM: ‘/travel-insurance/student/yue’,
4:53:27 PM: ‘/travel-insurance/visitor’,
4:53:27 PM: ‘/travel-insurance/visitor/ko’,
4:53:27 PM: ‘/travel-insurance/visitor/ar’,
4:53:27 PM: ‘/travel-insurance/visitor/ch_s’,
4:53:27 PM: ‘/travel-insurance/visitor/ch_t’,
4:53:27 PM: ‘/travel-insurance/visitor/de’,
4:53:27 PM: ‘/travel-insurance/visitor/es’,
4:53:27 PM: ‘/travel-insurance/visitor/fa’,
4:53:27 PM: ‘/travel-insurance/visitor/fr’,
4:53:27 PM: ‘/travel-insurance/visitor/ja’,
4:53:27 PM: ‘/travel-insurance/visitor/pt_br’,
4:53:27 PM: ‘/travel-insurance/student/yue’
4:53:27 PM: ],
4:53:27 PM: delay: 1500,
4:53:27 PM: userAgent: ‘react-hydratable’,
4:53:27 PM: htmlPrefix: ‘’
4:53:27 PM: }
4:53:27 PM: createHttpServer: server is started
4:53:27 PM: createHttpServer: ready (PORT 3000)
4:53:27 PM: Crawling: start
4:53:27 PM: Crawling: [Start] http://localhost:3000/
4:53:30 PM: Crawling: [Start] http://localhost:3000/ko
4:53:30 PM: Crawling: [OK] http://localhost:3000/
4:53:32 PM: Crawling: [Start] http://localhost:3000/ar
4:53:32 PM: Crawling: [OK] http://localhost:3000/ko
4:53:34 PM: Crawling: [Start] http://localhost:3000/ch_s
4:53:34 PM: Crawling: [OK] http://localhost:3000/ar
4:53:36 PM: Crawling: [Start] http://localhost:3000/ch_t
4:53:36 PM: Crawling: [OK] http://localhost:3000/ch_s
4:53:38 PM: Crawling: [Start] http://localhost:3000/de
4:53:38 PM: Crawling: [OK] http://localhost:3000/ch_t
4:53:40 PM: Crawling: [Start] http://localhost:3000/es
4:53:40 PM: Crawling: [OK] http://localhost:3000/de
4:53:42 PM: Crawling: [Start] http://localhost:3000/fa
4:53:42 PM: Crawling: [OK] http://localhost:3000/es
4:53:44 PM: Crawling: [Start] http://localhost:3000/fr
4:53:44 PM: Crawling: [OK] http://localhost:3000/fa
4:53:46 PM: Crawling: [Start] http://localhost:3000/ja
4:53:46 PM: Crawling: [OK] http://localhost:3000/fr
4:53:48 PM: Crawling: [Start] http://localhost:3000/pt_br
4:53:48 PM: Crawling: [OK] http://localhost:3000/ja
4:53:49 PM: Crawling: [Start] http://localhost:3000/yue
4:53:49 PM: Crawling: [OK] http://localhost:3000/pt_br
4:53:51 PM: Crawling: [Start] http://localhost:3000/travel-insurance
4:53:51 PM: Crawling: [OK] http://localhost:3000/yue
4:53:54 PM: Crawling: [Start] http://localhost:3000/travel-insurance/ko
4:53:54 PM: Crawling: [OK] http://localhost:3000/travel-insurance
4:53:56 PM: Crawling: [Start] http://localhost:3000/travel-insurance/ar
4:53:56 PM: Crawling: [OK] http://localhost:3000/travel-insurance/ko
4:53:59 PM: Crawling: [Start] http://localhost:3000/travel-insurance/ch_s
4:53:59 PM: Crawling: [OK] http://localhost:3000/travel-insurance/ar
4:54:01 PM: Crawling: [Start] http://localhost:3000/travel-insurance/ch_t
4:54:01 PM: Crawling: [OK] http://localhost:3000/travel-insurance/ch_s
4:54:03 PM: Crawling: [Start] http://localhost:3000/travel-insurance/de
4:54:03 PM: Crawling: [OK] http://localhost:3000/travel-insurance/ch_t
4:54:06 PM: Crawling: [Start] http://localhost:3000/travel-insurance/es
4:54:06 PM: Crawling: [OK] http://localhost:3000/travel-insurance/de
4:54:08 PM: Crawling: [Start] http://localhost:3000/travel-insurance/fa
4:54:08 PM: Crawling: [OK] http://localhost:3000/travel-insurance/es
4:54:11 PM: Crawling: [Start] http://localhost:3000/travel-insurance/fr
4:54:11 PM: Crawling: [OK] http://localhost:3000/travel-insurance/fa
4:54:13 PM: Crawling: [Start] http://localhost:3000/travel-insurance/ja
4:54:13 PM: Crawling: [OK] http://localhost:3000/travel-insurance/fr
4:54:16 PM: Crawling: [Start] http://localhost:3000/travel-insurance/pt_br
4:54:16 PM: Crawling: [OK] http://localhost:3000/travel-insurance/ja
4:54:19 PM: Crawling: [Start] http://localhost:3000/travel-insurance/yue
4:54:19 PM: Crawling: [OK] http://localhost:3000/travel-insurance/pt_br
4:54:22 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student
4:54:22 PM: Crawling: [OK] http://localhost:3000/travel-insurance/yue
4:54:24 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student/ko
4:54:24 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student
4:54:26 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student/ar
4:54:26 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/ko
4:54:28 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student/ch_s
4:54:28 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/ar
4:54:29 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student/ch_t
4:54:29 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/ch_s
4:54:31 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student/de
4:54:31 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/ch_t
4:54:33 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student/es
4:54:33 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/de
4:54:35 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student/fa
4:54:35 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/es
4:54:37 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student/fr
4:54:37 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/fa
4:54:39 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student/ja
4:54:39 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/fr
4:54:41 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student/pt_br
4:54:41 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/ja
4:54:43 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student/yue
4:54:43 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/pt_br
4:54:45 PM: Crawling: [Start] http://localhost:3000/travel-insurance/visitor
4:54:45 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/yue
4:54:47 PM: Crawling: [Start] http://localhost:3000/travel-insurance/visitor/ko
4:54:47 PM: Crawling: [OK] http://localhost:3000/travel-insurance/visitor
4:54:49 PM: Crawling: [Start] http://localhost:3000/travel-insurance/visitor/ar
4:54:49 PM: Crawling: [OK] http://localhost:3000/travel-insurance/visitor/ko
4:54:51 PM: Crawling: [Start] http://localhost:3000/travel-insurance/visitor/ch_s
4:54:51 PM: Crawling: [OK] http://localhost:3000/travel-insurance/visitor/ar
4:54:53 PM: Crawling: [Start] http://localhost:3000/travel-insurance/visitor/ch_t
4:54:53 PM: Crawling: [OK] http://localhost:3000/travel-insurance/visitor/ch_s
4:54:55 PM: Crawling: [Start] http://localhost:3000/travel-insurance/visitor/de
4:54:55 PM: Crawling: [OK] http://localhost:3000/travel-insurance/visitor/ch_t
4:54:57 PM: Crawling: [Start] http://localhost:3000/travel-insurance/visitor/es
4:54:57 PM: Crawling: [OK] http://localhost:3000/travel-insurance/visitor/de
4:54:59 PM: Crawling: [Start] http://localhost:3000/travel-insurance/visitor/fa
4:54:59 PM: Crawling: [OK] http://localhost:3000/travel-insurance/visitor/es
4:55:01 PM: Crawling: [Start] http://localhost:3000/travel-insurance/visitor/fr
4:55:01 PM: Crawling: [OK] http://localhost:3000/travel-insurance/visitor/fa
4:55:02 PM: Crawling: [Start] http://localhost:3000/travel-insurance/visitor/ja
4:55:02 PM: Crawling: [OK] http://localhost:3000/travel-insurance/visitor/fr
4:55:05 PM: Crawling: [Start] http://localhost:3000/travel-insurance/visitor/pt_br
4:55:05 PM: Crawling: [OK] http://localhost:3000/travel-insurance/visitor/ja
4:55:06 PM: Crawling: [Start] http://localhost:3000/travel-insurance/student/yue
4:55:06 PM: Crawling: [OK] http://localhost:3000/travel-insurance/visitor/pt_br
4:55:08 PM: Crawling: end
4:55:08 PM: createHttpServer: server is closed
4:55:08 PM: Crawling: [OK] http://localhost:3000/travel-insurance/student/yue
4:55:08 PM: ​
4:55:08 PM: (build.command completed in 2m 31.2s)
4:55:08 PM: ​
4:55:09 PM: (Netlify Build completed in 2m 31.5s)
4:55:09 PM: Section completed: building
4:55:16 PM: Finished processing build request in 3m6.285s

I can still see the script in your <head>:

Regarding the database errors, I’m not sure if you mean this:

If yes, I don’t think you’re hosting the API on Netlify. You’d have to make a request to your API and not the Netlify site.

Hi,

I have a build folder within the client directory, and inside the build folder, there is an index.html file. During the build process, I noticed that the <script> tags are being placed in the <head> section instead of where I want them. I’m unsure how to resolve this issue.

That we cannot speak for unfortunately. We don’t know your code or your build process.

The specific problem I’m facing is related to pulling data from my own Postgre database. When making the API call, I receive an error indicating a failure to retrieve the necessary data. It’s important to note that the API call works perfectly fine on the current website running under Heroku, with no issues reported.

I have meticulously ensured that all the environment variables required for database connectivity are set up in Netlify, matching the exact configurations used in the Heroku environment. Despite this, I am still experiencing errors in the Netlify deployment.

I would greatly appreciate your assistance in identifying any potential missing steps or misconfigurations that might be causing this issue in the Netlify deployment. Specifically, I would like to confirm if there are any additional settings or configurations that need to be adjusted within the Netlify environment to establish a successful connection with the Postgre database.

There are 2 mutually exclusive problems here. One is about the scrollTop issue which we’ve already told what to do, the other is about the API, which can been already answered as well:

I think it goes without saying that since Netlify isn’t hosting your API, making a request to Netlify to handle your API routing doesn’t make complete sense. You need to request data from Heroku endpoints.

So, if I understand correctly, you’re suggesting that I should utilize both Heroku and Netlify to host my website? My initial plan was to transfer all my content from Heroku to Netlify, but that might cause confusion.

Hi, @stonewell. This support guide explains the issue in more detail:

If there are questions that the support guide above doesn’t answer, please let us know.