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

Netlify warnings on build #7361

Closed
1 task
braco opened this issue Jun 11, 2023 · 3 comments
Closed
1 task

Netlify warnings on build #7361

braco opened this issue Jun 11, 2023 · 3 comments
Labels
- P2: nice to have Not breaking anything but nice to have (priority) feat: ssr Related to SSR (scope) needs repro Issue needs a reproduction

Comments

@braco
Copy link

braco commented Jun 11, 2023

What version of astro are you using?

2.6.3

Are you using an SSR adapter? If so, which one?

netlify

What package manager are you using?

yarn

What operating system are you using?

mac

What browser are you using?

chrome

Describe the Bug

Netlify is showing these warnings on build, though everything seems to work still:

7:23:55 PM: Packaging Functions from .netlify/functions-internal directory:
7:23:55 PM:  - entry.mjs
7:23:55 PM:  - renderers.mjs
7:23:55 PM: ​
7:23:55 PM: ▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist/index.js" was marked as having no side effects
7:23:55 PM:     .netlify/functions-internal/renderers.mjs:8:7:
7:23:55 PM:       8 │ import 'path-to-regexp';
7:23:55 PM:         ╵        ~~~~~~~~~~~~~~~~
7:23:55 PM:   "sideEffects" is false in the enclosing "package.json" file
7:23:55 PM:     node_modules/path-to-regexp/package.json:45:2:
7:23:55 PM:       45 │   "sideEffects": false,
7:23:55 PM:          ╵   ~~~~~~~~~~~~~
7:23:55 PM: ▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist/index.js" was marked as having no side effects
7:23:55 PM:     .netlify/functions-internal/entry.mjs:11:7:
7:23:55 PM:       11 │ import 'path-to-regexp';
7:23:55 PM:          ╵        ~~~~~~~~~~~~~~~~
7:23:55 PM:   "sideEffects" is false in the enclosing "package.json" file
7:23:55 PM:     node_modules/path-to-regexp/package.json:45:2:
7:23:55 PM:       45 │   "sideEffects": false,
7:23:55 PM:          ╵   ~~~~~~~~~~~~~
7:23:55 PM: ▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist/index.js" was marked as having no side effects
7:23:55 PM:     .netlify/functions-internal/renderers.mjs:8:7:
7:23:55 PM:       8 │ import 'path-to-regexp';
7:23:55 PM:         ╵        ~~~~~~~~~~~~~~~~
7:23:55 PM:   "sideEffects" is false in the enclosing "package.json" file
7:23:55 PM:     node_modules/path-to-regexp/package.json:45:2:
7:23:55 PM:       45 │   "sideEffects": false,
7:23:55 PM:          ╵   ~~~~~~~~~~~~~
7:23:55 PM: ▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist/index.js" was marked as having no side effects
7:23:55 PM:     .netlify/functions-internal/chunks/index@[email protected]:7:7:
7:23:55 PM:       7 │ import 'path-to-regexp';
7:23:55 PM:         ╵        ~~~~~~~~~~~~~~~~
7:23:55 PM:   "sideEffects" is false in the enclosing "package.json" file
7:23:55 PM:     node_modules/path-to-regexp/package.json:45:2:
7:23:55 PM:       45 │   "sideEffects": false,
7:23:55 PM:          ╵   ~~~~~~~~~~~~~
7:23:55 PM: ▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist/index.js" was marked as having no side effects
7:23:55 PM:     .netlify/functions-internal/chunks/_...5d7332d1.mjs:7:7:
7:23:55 PM:       7 │ import 'path-to-regexp';
7:23:55 PM:         ╵        ~~~~~~~~~~~~~~~~
7:23:55 PM:   "sideEffects" is false in the enclosing "package.json" file
7:23:55 PM:     node_modules/path-to-regexp/package.json:45:2:
7:23:55 PM:       45 │   "sideEffects": false,
7:23:55 PM:          ╵   ~~~~~~~~~~~~~
7:23:55 PM: ▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist/index.js" was marked as having no side effects
7:23:55 PM:     .netlify/functions-internal/chunks/_slug_@[email protected]:7:7:
7:23:55 PM:       7 │ import 'path-to-regexp';
7:23:55 PM:         ╵        ~~~~~~~~~~~~~~~~
7:23:55 PM:   "sideEffects" is false in the enclosing "package.json" file
7:23:55 PM:     node_modules/path-to-regexp/package.json:45:2:
7:23:55 PM:       45 │   "sideEffects": false,
7:23:55 PM:          ╵   ~~~~~~~~~~~~~
7:23:55 PM: ▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist/index.js" was marked as having no side effects
7:23:55 PM:     .netlify/functions-internal/chunks/research@[email protected]:7:7:
7:23:55 PM:       7 │ import 'path-to-regexp';
7:23:55 PM:         ╵        ~~~~~~~~~~~~~~~~
7:23:55 PM:   "sideEffects" is false in the enclosing "package.json" file
7:23:55 PM:     node_modules/path-to-regexp/package.json:45:2:
7:23:55 PM:       45 │   "sideEffects": false,
7:23:55 PM:          ╵   ~~~~~~~~~~~~~
7:23:55 PM: ▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist/index.js" was marked as having no side effects
7:23:55 PM:     .netlify/functions-internal/chunks/_page_@[email protected]:7:7:
7:23:55 PM:       7 │ import 'path-to-regexp';
7:23:55 PM:         ╵        ~~~~~~~~~~~~~~~~
7:23:55 PM:   "sideEffects" is false in the enclosing "package.json" file
7:23:55 PM:     node_modules/path-to-regexp/package.json:45:2:
7:23:55 PM:       45 │   "sideEffects": false,
7:23:55 PM:          ╵   ~~~~~~~~~~~~~
7:23:55 PM: ▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist/index.js" was marked as having no side effects
7:23:55 PM:     .netlify/functions-internal/chunks/_terms_@[email protected]:7:7:
7:23:55 PM:       7 │ import 'path-to-regexp';
7:23:55 PM:         ╵        ~~~~~~~~~~~~~~~~
7:23:55 PM:   "sideEffects" is false in the enclosing "package.json" file
7:23:55 PM:     node_modules/path-to-regexp/package.json:45:2:
7:23:55 PM:       45 │   "sideEffects": false,
7:23:55 PM:          ╵   ~~~~~~~~~~~~~
7:23:55 PM: ▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist/index.js" was marked as having no side effects
7:23:55 PM:     .netlify/functions-internal/chunks/_terms_@[email protected]:7:7:
7:23:55 PM:       7 │ import 'path-to-regexp';
7:23:55 PM:         ╵        ~~~~~~~~~~~~~~~~
7:23:55 PM:   "sideEffects" is false in the enclosing "package.json" file
7:23:55 PM:     node_modules/path-to-regexp/package.json:45:2:
7:23:55 PM:       45 │   "sideEffects": false,
7:23:55 PM:          ╵   ~~~~~~~~~~~~~
7:23:55 PM: ▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist/index.js" was marked as having no side effects
7:23:55 PM:     .netlify/functions-internal/chunks/search@[email protected]:7:7:
7:23:55 PM:       7 │ import 'path-to-regexp';
7:23:55 PM:         ╵        ~~~~~~~~~~~~~~~~
7:23:55 PM:   "sideEffects" is false in the enclosing "package.json" file
7:23:55 PM:     node_modules/path-to-regexp/package.json:45:2:
7:23:55 PM:       45 │   "sideEffects": false,
7:23:55 PM:          ╵   ~~~~~~~~~~~~~
7:23:55 PM: 10 of 29 warnings shown (disable the message limit with --log-limit=0)
7:23:55 PM: ​
7:23:55 PM: ❯ Functions bundled with warnings:
7:23:55 PM:    - entry.zip
7:23:55 PM:    - renderers.zip
7:23:55 PM: ​
7:23:55 PM: ❯ The following Node.js modules use dynamic expressions to include files:
7:23:55 PM:    - astro
7:23:55 PM: ​
7:23:55 PM:   Because files included with dynamic expressions aren't bundled with your serverless functions by default,
  this may result in an error when invoking a function. To resolve this error, you can mark these Node.js
7:23:55 PM:   modules as external in the [functions] section of your `netlify.toml` configuration file:
7:23:55 PM: ​
7:23:55 PM:   [functions]
7:23:55 PM:     external_node_modules = ["astro"]
7:23:55 PM: ​
7:23:55 PM:   Visit https://ntl.fyi/dynamic-imports for more information.
7:23:55 PM: ​
7:23:55 PM: ​
7:23:55 PM: (Functions bundling completed in 332ms)
7:23:55 PM: ​
7:24:02 PM: (Netlify Build completed in 10.2s)
7:24:04 PM: Section completed: building
7:24:10 PM: Finished processing build request in 37.237s

Link to Minimal Reproducible Example

https://...

Participation

  • I am willing to submit a pull request for this issue.
@bluwy
Copy link
Member

bluwy commented Jun 11, 2023

It's caused by https://rollupjs.org/faqs/#why-do-additional-imports-turn-up-in-my-entry-chunks-when-code-splitting. Maybe we can turn off output.hoistTransitiveImports for netlify functions build by default.

@bluwy bluwy added the - P2: nice to have Not breaking anything but nice to have (priority) label Jun 11, 2023
@Princesseuh Princesseuh added the feat: ssr Related to SSR (scope) label Jul 17, 2023
@matthewp matthewp added the needs repro Issue needs a reproduction label Aug 10, 2023
@github-actions
Copy link
Contributor

Hello @braco. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2023
@x71c9
Copy link

x71c9 commented Aug 14, 2023

I managed to remove the warnings with this: #6291 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority) feat: ssr Related to SSR (scope) needs repro Issue needs a reproduction
Projects
None yet
Development

No branches or pull requests

5 participants