errors.js 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. "use strict";
  2. /*
  3. Copyright 2018 Google LLC
  4. Use of this source code is governed by an MIT-style
  5. license that can be found in the LICENSE file or at
  6. https://opensource.org/licenses/MIT.
  7. */
  8. const ol = require('common-tags').oneLine;
  9. module.exports = {
  10. 'unable-to-get-rootdir': `Unable to get the root directory of your web app.`,
  11. 'no-extension': ol`Unable to detect a usable extension for a file in your web
  12. app directory.`,
  13. 'invalid-file-manifest-name': ol`The File Manifest Name must have at least one
  14. character.`,
  15. 'unable-to-get-file-manifest-name': 'Unable to get a file manifest name.',
  16. 'invalid-sw-dest': `The 'swDest' value must be a valid path.`,
  17. 'unable-to-get-sw-name': 'Unable to get a service worker file name.',
  18. 'unable-to-get-save-config': ol`An error occurred when asking to save details
  19. in a config file.`,
  20. 'unable-to-get-file-hash': ol`An error occurred when attempting to create a
  21. file hash.`,
  22. 'unable-to-get-file-size': ol`An error occurred when attempting to get a file
  23. size.`,
  24. 'unable-to-glob-files': 'An error occurred when globbing for files.',
  25. 'unable-to-make-manifest-directory': ol`Unable to make output directory for
  26. file manifest.`,
  27. 'read-manifest-template-failure': 'Unable to read template for file manifest',
  28. 'populating-manifest-tmpl-failed': ol`An error occurred when populating the
  29. file manifest template.`,
  30. 'manifest-file-write-failure': 'Unable to write the file manifest.',
  31. 'unable-to-make-sw-directory': ol`Unable to make the directories to output
  32. the service worker path.`,
  33. 'read-sw-template-failure': ol`Unable to read the service worker template
  34. file.`,
  35. 'sw-write-failure': 'Unable to write the service worker file.',
  36. 'sw-write-failure-directory': ol`Unable to write the service worker file;
  37. 'swDest' should be a full path to the file, not a path to a directory.`,
  38. 'unable-to-copy-workbox-libraries': ol`One or more of the Workbox libraries
  39. could not be copied over to the destination directory: `,
  40. 'invalid-generate-sw-input': ol`The input to generateSW() must be an object.`,
  41. 'invalid-glob-directory': ol`The supplied globDirectory must be a path as a
  42. string.`,
  43. 'invalid-dont-cache-bust': ol`The supplied 'dontCacheBustURLsMatching'
  44. parameter must be a RegExp.`,
  45. 'invalid-exclude-files': 'The excluded files should be an array of strings.',
  46. 'invalid-get-manifest-entries-input': ol`The input to
  47. 'getFileManifestEntries()' must be an object.`,
  48. 'invalid-manifest-path': ol`The supplied manifest path is not a string with
  49. at least one character.`,
  50. 'invalid-manifest-entries': ol`The manifest entries must be an array of
  51. strings or JavaScript objects containing a url parameter.`,
  52. 'invalid-manifest-format': ol`The value of the 'format' option passed to
  53. generateFileManifest() must be either 'iife' (the default) or 'es'.`,
  54. 'invalid-static-file-globs': ol`The 'globPatterns' value must be an array
  55. of strings.`,
  56. 'invalid-templated-urls': ol`The 'templatedURLs' value should be an object
  57. that maps URLs to either a string, or to an array of glob patterns.`,
  58. 'templated-url-matches-glob': ol`One of the 'templatedURLs' URLs is already
  59. being tracked via 'globPatterns': `,
  60. 'invalid-glob-ignores': ol`The 'globIgnores' parameter must be an array of
  61. glob pattern strings.`,
  62. 'manifest-entry-bad-url': ol`The generated manifest contains an entry without
  63. a URL string. This is likely an error with workbox-build.`,
  64. 'modify-url-prefix-bad-prefixes': ol`The 'modifyURLPrefix' parameter must be
  65. an object with string key value pairs.`,
  66. 'invalid-inject-manifest-arg': ol`The input to 'injectManifest()' must be an
  67. object.`,
  68. 'injection-point-not-found': ol`Unable to find a place to inject the manifest.
  69. Please ensure that your service worker file contains the following: `,
  70. 'multiple-injection-points': ol`Please ensure that your 'swSrc' file contains
  71. only one match for the following: `,
  72. 'populating-sw-tmpl-failed': ol`Unable to generate service worker from
  73. template.`,
  74. 'useless-glob-pattern': ol`One of the glob patterns doesn't match any files.
  75. Please remove or fix the following: `,
  76. 'bad-template-urls-asset': ol`There was an issue using one of the provided
  77. 'templatedURLs'.`,
  78. 'invalid-runtime-caching': ol`The 'runtimeCaching' parameter must an an
  79. array of objects with at least a 'urlPattern' and 'handler'.`,
  80. 'static-file-globs-deprecated': ol`'staticFileGlobs' is deprecated.
  81. Please use 'globPatterns' instead.`,
  82. 'dynamic-url-deprecated': ol`'dynamicURLToDependencies' is deprecated.
  83. Please use 'templatedURLs' instead.`,
  84. 'urlPattern-is-required': ol`The 'urlPattern' option is required when using
  85. 'runtimeCaching'.`,
  86. 'handler-is-required': ol`The 'handler' option is required when using
  87. runtimeCaching.`,
  88. 'invalid-generate-file-manifest-arg': ol`The input to generateFileManifest()
  89. must be an Object.`,
  90. 'invalid-sw-src': `The 'swSrc' file can't be read.`,
  91. 'same-src-and-dest': ol`Unable to find a place to inject the manifest. This is
  92. likely because swSrc and swDest are configured to the same file.
  93. Please ensure that your swSrc file contains the following:`,
  94. 'only-regexp-routes-supported': ol`Please use a regular expression object as
  95. the urlPattern parameter. (Express-style routes are not currently
  96. supported.)`,
  97. 'bad-runtime-caching-config': ol`An unknown configuration option was used
  98. with runtimeCaching: `,
  99. 'invalid-network-timeout-seconds': ol`When using networkTimeoutSeconds, you
  100. must set the handler to 'NetworkFirst'.`,
  101. 'no-module-name': ol`You must provide a moduleName parameter when calling
  102. getModuleURL().`,
  103. 'bad-manifest-transforms-return-value': ol`The return value from a
  104. manifestTransform should be an object with 'manifest' and optionally
  105. 'warnings' properties.`,
  106. 'string-entry-warning': ol`Some items were passed to additionalManifestEntries
  107. without revisioning info. This is generally NOT safe. Learn more at
  108. https://bit.ly/wb-precache.`,
  109. 'no-manifest-entries-or-runtime-caching': ol`Couldn't find configuration for
  110. either precaching or runtime caching. Please ensure that the various glob
  111. options are set to match one or more files, and/or configure the
  112. runtimeCaching option.`,
  113. 'cant-find-sourcemap': ol`The swSrc file refers to a sourcemap that can't be
  114. opened:`
  115. };