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

TypeError: filename.endsWith is not a function #138

Closed
i-bsd opened this issue Oct 28, 2021 · 2 comments · Fixed by #154
Closed

TypeError: filename.endsWith is not a function #138

i-bsd opened this issue Oct 28, 2021 · 2 comments · Fixed by #154
Labels
bug Something isn't working

Comments

@i-bsd
Copy link

i-bsd commented Oct 28, 2021

Using the extractCritical option:


{
      resolve: 'gatsby-plugin-linaria',
      options: {
        extractCritical: true,
      },
    },

gives me this error when building:

TypeError: filename.endsWith is not a function

  • Gatsby 4
  • Node 16.6.0
  • Linaria 3.0.0-beta.13
  • gatsby-plugin-linaria 3.1.0
@cometkim cometkim added the bug Something isn't working label Nov 11, 2021
@joyfulelement
Copy link

Encountered the same issue, curious if there is a fallback version that can work with the extractCritical: true option?

Here is the full stack trace

ERROR 

filename.endsWith is not a function



  TypeError: filename.endsWith is not a function
  
  - gatsby-node.js:95 test
    [mysite]/[gatsby-plugin-linaria]/gatsby-node.js:95:34
  
  - SplitChunksPlugin.js:506 checkTest
    [mysite]/[webpack]/lib/optimize/SplitChunksPlugin.js:506:10
  
  - SplitChunksPlugin.js:470 
    [mysite]/[webpack]/lib/optimize/SplitChunksPlugin.js:470:7
  
  - SplitChunksPlugin.js:488 Object.fn [as getCacheGroups]
    [mysite]/[webpack]/lib/optimize/SplitChunksPlugin.js:488:5
  
  - SplitChunksPlugin.js:1189 
    [mysite]/[webpack]/lib/optimize/SplitChunksPlugin.js:1189:38
  
  
  - Hook.js:14 Hook.CALL_DELEGATE [as _call]
    [mysite]/[webpack]/[tapable]/lib/Hook.js:14:14
  
  - Compilation.js:2949 Compilation.seal
    [mysite]/[webpack]/lib/Compilation.js:2949:36
  
  - Compiler.js:1120 
    [mysite]/[webpack]/lib/Compiler.js:1120:20
  
  - Compilation.js:2752 
    [mysite]/[webpack]/lib/Compilation.js:2752:4
  
  
  - FlagDependencyExportsPlugin.js:385 
    [mysite]/[webpack]/lib/FlagDependencyExportsPlugin.js:385:11
  
  - async.js:2830 
    [mysite]/[neo-async]/async.js:2830:7
  
  - async.js:2850 Object.each
    [mysite]/[neo-async]/async.js:2850:39
  
  - FlagDependencyExportsPlugin.js:361 
    [mysite]/[webpack]/lib/FlagDependencyExportsPlugin.js:361:18
  
  - async.js:2830 
    [mysite]/[neo-async]/async.js:2830:7

Info

> gatsby info


  System:
    OS: macOS 12.3.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    Yarn: 1.22.15 - ~/.nvm/versions/node/v16.14.2/bin/yarn
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
  Browsers:
    Chrome: 102.0.5005.115
    Firefox: 100.0.2
    Safari: 15.4
  npmPackages:
    gatsby: 4.16.0 => 4.16.0
    gatsby-cli: 4.16.0 => 4.16.0
    gatsby-plugin-algolia: 0.25.0 => 0.25.0
    gatsby-plugin-canonical-urls: 4.16.0 => 4.16.0
    gatsby-plugin-catch-links: 4.16.0 => 4.16.0
    gatsby-plugin-feed: 4.16.0 => 4.16.0
    gatsby-plugin-gtag: 1.0.13 => 1.0.13
    gatsby-plugin-image: 2.12.1 => 2.12.1
    gatsby-plugin-layout: 3.11.0 => 3.11.0
    gatsby-plugin-linaria: 3.2.0 => 3.2.0
    gatsby-plugin-manifest: 4.16.0 => 4.16.0
    gatsby-plugin-preload-fonts: 3.12.1 => 3.12.1
    gatsby-plugin-react-helmet: 5.12.0 => 5.12.0
    gatsby-plugin-react-svg: 3.1.0 => 3.1.0
    gatsby-plugin-remove-serviceworker: 1.0.0 => 1.0.0
    gatsby-plugin-robots-txt: 1.7.0 => 1.7.0
    gatsby-plugin-s3: 0.3.8 => 0.3.8
    gatsby-plugin-sharp: 4.16.1 => 4.16.1
    gatsby-plugin-sitemap: 5.12.1 => 5.12.1
    gatsby-plugin-use-dark-mode: 1.5.0 => 1.5.0
    gatsby-remark-autolink-headers: 5.12.1 => 5.12.1
    gatsby-remark-copy-linked-files: 5.12.1 => 5.12.1
    gatsby-remark-emoji: 0.0.3 => 0.0.3
    gatsby-remark-external-links: 0.0.4 => 0.0.4
    gatsby-remark-images: 6.12.1 => 6.12.1
    gatsby-remark-images-medium-zoom: 1.7.0 => 1.7.0
    gatsby-remark-responsive-iframe: 5.12.1 => 5.12.1
    gatsby-remark-smartypants: 5.12.1 => 5.12.1
    gatsby-source-contentful: 7.10.1 => 7.10.1
    gatsby-source-filesystem: 4.16.0 => 4.16.0
    gatsby-transformer-remark: 5.12.1 => 5.12.1
    gatsby-transformer-sharp: 4.16.0 => 4.16.0
@cometkim cometkim mentioned this issue Aug 13, 2022
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
3 participants